From: Daan De Meyer Date: Tue, 6 Aug 2024 07:55:56 +0000 (+0200) Subject: Store finalized values only on config object X-Git-Tag: v25~366^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c606cd84a1acc2dc7b58fab7ed4b56e830737cd0;p=thirdparty%2Fmkosi.git Store finalized values only on config object This allows us to use context.config to determine whether a value was specified in a configuration file or not. --- diff --git a/mkosi/config.py b/mkosi/config.py index 2eeebb9d5..c919a3473 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -3807,13 +3807,14 @@ def parse_config(argv: Sequence[str] = (), *, resources: Path = Path("/")) -> tu if args.directory is not None: context.parse_config_one(Path("."), profiles=True, local=True) + config = copy.deepcopy(context.config) + # After we've finished parsing the configuration, we'll have values in both # namespaces (context.cli, context.config). To be able to parse the values from a # single namespace, we merge the final values of each setting into one namespace. for s in SETTINGS: - setattr(context.config, s.dest, context.finalize_value(s)) + setattr(config, s.dest, context.finalize_value(s)) - config = copy.deepcopy(context.config) images = [] if args.directory is not None and Path("mkosi.images").exists():