From: Daan De Meyer Date: Sun, 22 Oct 2023 13:24:38 +0000 (+0200) Subject: Set the preset field before we parse the preset's config X-Git-Tag: v19~55^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d5337f7dd4173871e7992d0e8a06f335a5952ac;p=thirdparty%2Fmkosi.git Set the preset field before we parse the preset's config In case we ever want to add a match setting for the current preset. --- diff --git a/mkosi/config.py b/mkosi/config.py index a330d8bd4..ba4ba371f 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -2368,11 +2368,12 @@ def parse_config(argv: Sequence[str] = ()) -> tuple[MkosiArgs, tuple[MkosiConfig ns_copy = copy.deepcopy(namespace) defaults_copy = copy.deepcopy(defaults) + setattr(ns_copy, "preset", name) + with chdir(p if p.is_dir() else Path.cwd()): if not parse_config(p if p.is_file() else Path("."), ns_copy, defaults_copy): continue - setattr(ns_copy, "preset", name) finalize_defaults(ns_copy, defaults_copy) presets += [ns_copy]