]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
config: Make sure we write finalized values into the history
authorDaan De Meyer <daan@amutable.com>
Fri, 13 Feb 2026 08:02:47 +0000 (09:02 +0100)
committerDaan De Meyer <daan@amutable.com>
Fri, 13 Feb 2026 08:11:49 +0000 (09:11 +0100)
Otherwise if we specify e.g. --package-directories= on the command
line it'll get written as None into the history and won't get parsed
properly by Config.from_partial_json().

mkosi/config.py

index fbcc799e8e4068deb80ea704de0fd1b2113c0892..0de06c083aecac68c16df2870bb00fe04d19783c 100644 (file)
@@ -5376,11 +5376,14 @@ def parse_config(
 
         context.cli |= history
 
-    cli = copy.deepcopy(context.cli)
-
     # One of the specifiers needs access to the directory, so make sure it is available.
     context.config["directory"] = args.directory
 
+    cli = copy.deepcopy(context.cli)
+    for dest in cli:
+        if dest in SETTINGS_LOOKUP_BY_DEST:
+            cli[dest] = context.finalize_value(SETTINGS_LOOKUP_BY_DEST[dest])
+
     context.parse_new_includes()
 
     context.config["files"] = []