From: Daan De Meyer Date: Thu, 13 Feb 2025 20:38:55 +0000 (+0100) Subject: Move two more checks from load_config() to check_inputs() X-Git-Tag: v26~384^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3fade0acdcb0fc18314da841dffcecfd73a59897;p=thirdparty%2Fmkosi.git Move two more checks from load_config() to check_inputs() --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 15b5546e4..aa45675d9 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -2604,6 +2604,12 @@ def check_inputs(config: Config) -> None: Make sure all the inputs exist that aren't checked during config parsing because they might be created by an earlier build. """ + if config.overlay and not config.base_trees: + die("--overlay=yes can only be used with --base-tree=") + + if config.incremental and not config.cache_dir: + die("A cache directory must be configured in order to use --incremental=yes") + for base in config.base_trees: if not base.exists(): die(f"Base tree {base} not found") diff --git a/mkosi/config.py b/mkosi/config.py index 50b4b1bdc..b41d67ced 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -4768,12 +4768,6 @@ def load_config(config: argparse.Namespace) -> Config: config.environment = load_environment(config) - if config.overlay and not config.base_trees: - die("--overlay can only be used with --base-tree") - - if config.incremental and not config.cache_dir: - die("A cache directory must be configured in order to use --incremental") - return Config.from_namespace(config)