From: Daan De Meyer Date: Sun, 30 Mar 2025 17:16:26 +0000 (+0200) Subject: config: Various cleanups for the directory attribute X-Git-Tag: v26~285^2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d61e12bf9041a91ccb666cfc42fe3f684f93c34c;p=thirdparty%2Fmkosi.git config: Various cleanups for the directory attribute - Make sure it is always set and looked up on the config ns - Make sure we set it before parsing includes from the command line --- diff --git a/mkosi/config.py b/mkosi/config.py index c28d639dc..94d451ec8 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -4537,7 +4537,7 @@ class ParseContext: # Some specifier methods might want to access the image name or directory mkosi was # invoked in so let's make sure those are available. setattr(specifierns, "image", getattr(self.config, "image")) - setattr(specifierns, "directory", self.cli.directory) + setattr(specifierns, "directory", getattr(self.config, "directory")) for d in specifier.depends: setting = SETTINGS_LOOKUP_BY_DEST[d] @@ -4659,7 +4659,7 @@ class ParseContext: # Some default factory methods want to access the image name or directory mkosi was invoked in so # let's make sure those are available. setattr(factoryns, "image", getattr(self.config, "image")) - setattr(factoryns, "directory", self.cli.directory) + setattr(factoryns, "directory", getattr(self.config, "directory")) default = setting.default_factory(factoryns) elif setting.default is not None: @@ -5023,10 +5023,11 @@ def parse_config( subimages = [] prev = None - context.parse_new_includes() - # One of the specifiers needs access to the directory, so make sure it is available. setattr(context.config, "directory", args.directory) + + context.parse_new_includes() + setattr(context.config, "files", []) # Parse the global configuration unless the user explicitly asked us not to.