]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Don't run configure scripts if we're reusing the history
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 6 Mar 2025 21:55:32 +0000 (22:55 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 7 Mar 2025 09:36:46 +0000 (10:36 +0100)
mkosi/__init__.py
mkosi/resources/man/mkosi.1.md

index 66b703743ab52b1652b950e1554274b4a0da137c..df59b1a7184de0c1549b0145e4c0a8ad625218b5 100644 (file)
@@ -5166,17 +5166,16 @@ def run_verb(args: Args, images: Sequence[Config], *, resources: Path) -> None:
             if args.force > 1 or not have_cache(initrd):
                 remove_cache_entries(initrd)
 
-    for i, config in enumerate(images):
-        if args.verb != Verb.build:
-            check_tools(config, args.verb)
-
-        images[i] = config = run_configure_scripts(config)
+    if not have_history(args):
+        for i, config in enumerate(images):
+            if args.verb != Verb.build:
+                check_tools(config, args.verb)
 
-    # The images array has been modified so we need to reevaluate last again.
-    # Also ensure that all other images are reordered in case their dependencies were modified.
-    last = images[-1]
+            images[i] = config = run_configure_scripts(config)
 
-    if not have_history(args):
+        # The images array has been modified so we need to reevaluate last again.
+        # Also ensure that all other images are reordered in case their dependencies were modified.
+        last = images[-1]
         images = resolve_deps(images[:-1], last.dependencies) + [last]
 
     if (
index 816c5e93ebdfabff9f5816f9b7a1e8d00c6f7338..0dee6cd9ec7d88973d9498bc3d9b60407e3f689c 100644 (file)
@@ -1552,11 +1552,14 @@ boolean argument: either `1`, `yes`, or `true` to enable, or `0`, `no`,
     up in the generated XFS filesystem.
 
 `History=`, `--history=`
-:   Takes a boolean. If enabled, **mkosi** will write information about the
-    latest build to the `.mkosi-private` subdirectory in the directory
-    from which it was invoked. This information is then used to restore
-    the config of the latest build when running any verb that needs a
-    build without specifying `--force`.
+:   Takes a boolean. If enabled, **mkosi** will write information about
+    the latest build to the `.mkosi-private` subdirectory in the
+    directory from which it was invoked. This information is then used
+    to restore the config of the latest build when running any verb that
+    needs a build without specifying `--force`.
+
+    Note that configure scripts will not be executed if we reuse the
+    history from a previous build.
 
     To give an example of why this is useful, if you run
     `mkosi -O my-custom-output-dir -f` followed by `mkosi vm`, **mkosi**