]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Always check tools for build at the same place
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 22 Dec 2024 23:02:00 +0000 (00:02 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 23 Dec 2024 19:06:43 +0000 (20:06 +0100)
Let's only check non-build verb tools early and check build verb
tools at the same place regardless of whether the verb is build or
not to keep things more consistent.

As a side effect this allows building tools from source to do the
build in sync scripts which is done in
https://github.com/davide125/arcadeos/blob/main/mkosi.sync.

mkosi/__init__.py

index 89079b7a9be1843afead29a33f523c85fb32ab9e..e91000190fcc8f13d8ebf5a957fee481f1098ca6 100644 (file)
@@ -4724,7 +4724,9 @@ def run_verb(args: Args, images: Sequence[Config], *, resources: Path) -> None:
 
     for i, config in enumerate(images):
         with prepend_to_environ_path(config):
-            check_tools(config, args.verb)
+            if args.verb != Verb.build:
+                check_tools(config, args.verb)
+
             images[i] = config = run_configure_scripts(config)
 
     # The images array has been modified so we need to reevaluate last again.
@@ -4774,8 +4776,7 @@ def run_verb(args: Args, images: Sequence[Config], *, resources: Path) -> None:
                     continue
 
                 with prepend_to_environ_path(config):
-                    if args.verb != Verb.build:
-                        check_tools(config, Verb.build)
+                    check_tools(config, Verb.build)
 
                     check_inputs(config)
                     ensure_directories_exist(config)