]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
mkosi clean will now require --force in order to remove the tools tree.
authorUwe Sauter <19325781+UweSauter@users.noreply.github.com>
Wed, 26 Mar 2025 20:49:34 +0000 (21:49 +0100)
committerUwe Sauter <19325781+UweSauter@users.noreply.github.com>
Wed, 26 Mar 2025 20:49:34 +0000 (21:49 +0100)
Single source code change. Related documentation updates.
Also unrelated typo fix for ToolsSyncScripts=, --tools-tree-sync-script=.

mkosi/__init__.py
mkosi/resources/man/mkosi.1.md

index eb178f93f8772bf3c05885c01bbe9b3ce122ccd4..49e208ac6356c6d5866f31d4ff40a5e452b9ea74 100644 (file)
@@ -5024,7 +5024,7 @@ def run_verb(args: Args, images: Sequence[Config], *, resources: Path) -> None:
     last = images[-1]
 
     if args.verb == Verb.clean:
-        if tools:
+        if tools and args.force > 0:
             run_clean(args, tools)
 
         for config in images:
index 3c699f05e20c2d70f9d3f5455d60bd9410ffdc2d..f9f1f79a1267162c8fb94f834f7243ff8caca70e 100644 (file)
@@ -154,8 +154,8 @@ The following command line verbs are known:
 
 `clean`
 :   Remove build artifacts generated on a previous build. If combined
-    with `-f`, also removes incremental build cache images. If `-f` is
-    specified twice, also removes any package cache.
+    with `-f`, also removes incremental build cache images and the tools tree.
+    If `-f` is specified twice, also removes any package cache.
 
 `serve`
 :   This builds the image if it is not built yet, and then serves the
@@ -241,7 +241,8 @@ Those settings cannot be configured in the configuration files.
     removed too, before the re-build is initiated. For the `clean`
     operation this option has a slightly different effect: by default
     the verb will only remove build artifacts from a previous run, when
-    specified once the incremental cache files are deleted too, and when
+    specified once the incremental cache files and the tools tree are deleted
+    too, and when
     specified twice the package cache is also removed.
 
 `--directory=`, `-C`
@@ -1304,6 +1305,9 @@ boolean argument: either `1`, `yes`, or `true` to enable, or `0`, `no`,
     but the `mkosi.tools/` directory is found in the local directory it is
     automatically used for this purpose with the root directory as target.
 
+:   The tools tree directory is kept between repeated image builds unless
+    cleaned by calling `mkosi clean -f`.
+
     Note that binaries found in any of the paths configured with
     `ExtraSearchPaths=` will be executed with `/usr/` from the tools
     tree instead of from the host. If the host distribution or release
@@ -1417,7 +1421,7 @@ boolean argument: either `1`, `yes`, or `true` to enable, or `0`, `no`,
 `ToolsTreePackageDirectories=`, `--tools-tree-package-directory=`
 :   Same as `PackageDirectories=`, but for the default tools tree.
 
-`SyncScripts=`, `--sync-script=`
+`ToolsTreeSyncScripts=`, `--tools-tree-sync-script=`
 :   Same as `SyncScripts=`, but for the default tools tree.
 
 `ToolsTreePrepareScripts=`, `--tools-tree-prepare-script=`