]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Move two more checks from load_config() to check_inputs()
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 13 Feb 2025 20:38:55 +0000 (21:38 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 14 Feb 2025 13:45:27 +0000 (14:45 +0100)
mkosi/__init__.py
mkosi/config.py

index 15b5546e47f6144bd6867b1465bb16cc42c83bb3..aa45675d9fc063c0c2233e6d64e4bcef27ef68a6 100644 (file)
@@ -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")
index 50b4b1bdcc92933c598f48aec577061bdd3f05e8..b41d67ceda87b744cd261acb5c3e49228500cd30 100644 (file)
@@ -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)