]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Fail if --rerun-build-scripts is used and tools is out of date
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 12 Apr 2025 07:49:48 +0000 (09:49 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 12 Apr 2025 18:55:08 +0000 (20:55 +0200)
If --rerun-build-scripts is used, we shouldn't rebuild the tools
tree unless --force is specified as well, so make sure we check for
that specific case.

mkosi/__init__.py

index dc6838e55d62bde172b44abd02f091464b76755b..89380cc6dde66c0c80caff2965490abd0099f448 100644 (file)
@@ -5028,7 +5028,7 @@ def run_verb(args: Args, tools: Optional[Config], images: Sequence[Config], *, r
 
     # For the default tools tree have_cache() encompasses the "has the tools tree been built at all" check.
     if tools and not have_cache(tools):
-        if args.verb != Verb.build and args.force == 0:
+        if (args.rerun_build_scripts or args.verb != Verb.build) and args.force == 0:
             die(
                 f"Default tools tree requested for image '{last.image}' but it is out-of-date or has not "
                 "been built yet",