From: Daan De Meyer Date: Fri, 28 Mar 2025 20:43:53 +0000 (+0100) Subject: Make passed environment variables an inherited setting X-Git-Tag: v26~285^2~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19bb9d6a9e697aaa1e205e67b40e59ff12e8fcda;p=thirdparty%2Fmkosi.git Make passed environment variables an inherited setting --- diff --git a/mkosi/config.py b/mkosi/config.py index 71eee7382..9f1d846a3 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -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()