]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Make passed environment variables an inherited setting
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 28 Mar 2025 20:43:53 +0000 (21:43 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 30 Mar 2025 11:41:09 +0000 (13:41 +0200)
mkosi/config.py

index 71eee7382f8d3240b404c0869101de32f4c83162..9f1d846a39f224e51c13e3c06bd8da7abee3d9b1 100644 (file)
@@ -5004,16 +5004,6 @@ def parse_config(
             elif hasattr(context.cli, s.dest):
                 delattr(context.cli, s.dest)
 
-        setattr(
-            context.cli,
-            "environment",
-            {
-                name: getattr(config, "environment")[name]
-                for name in getattr(config, "pass_environment", {})
-                if name in getattr(config, "environment", {})
-            },
-        )
-
         for p in sorted(Path("mkosi.images").iterdir()):
             p = p.absolute()
 
@@ -5036,6 +5026,16 @@ def parse_config(
                 if s.scope == SettingScope.inherit and hasattr(config, s.dest):
                     setattr(context.config, s.dest, copy.deepcopy(getattr(config, s.dest)))
 
+            setattr(
+                context.config,
+                "environment",
+                {
+                    name: getattr(config, "environment")[name]
+                    for name in getattr(config, "pass_environment", {})
+                    if name in getattr(config, "environment", {})
+                },
+            )
+
             # Allow subimage configuration to include everything again.
             context.includes = set()
             context.defaults = argparse.Namespace()