From: Uwe Sauter <19325781+UweSauter@users.noreply.github.com> Date: Wed, 26 Mar 2025 20:49:34 +0000 (+0100) Subject: mkosi clean will now require --force in order to remove the tools tree. X-Git-Tag: v26~294^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=977be87e3e6336b808fcecb017573cb7e2912857;p=thirdparty%2Fmkosi.git mkosi clean will now require --force in order to remove the tools tree. Single source code change. Related documentation updates. Also unrelated typo fix for ToolsSyncScripts=, --tools-tree-sync-script=. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index eb178f93f..49e208ac6 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -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: diff --git a/mkosi/resources/man/mkosi.1.md b/mkosi/resources/man/mkosi.1.md index 3c699f05e..f9f1f79a1 100644 --- a/mkosi/resources/man/mkosi.1.md +++ b/mkosi/resources/man/mkosi.1.md @@ -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=`