From: Michael Ferrari Date: Wed, 20 Dec 2023 01:10:53 +0000 (+0100) Subject: Output files starting with `Output=` are removed X-Git-Tag: v20~50^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=beaaad12e9a5a6d12d26373fea49c730f9bf248f;p=thirdparty%2Fmkosi.git Output files starting with `Output=` are removed As preparation for the removal of `config.output_with_version` the removal of output files now only factors in `config.output` as prefix and no longer removes based on version suffix, due to that being added to `config.output` in a following commit. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 4733d5ffd..8d332b070 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -1847,21 +1847,19 @@ def empty_directory(path: Path) -> None: def unlink_output(args: MkosiArgs, config: MkosiConfig) -> None: # We remove any cached images if either the user used --force twice, or he/she called "clean" with it # passed once. Let's also remove the downloaded package cache if the user specified one additional - # "--force". Let's also remove all versions if the user specified one additional "--force". + # "--force". if args.verb == Verb.clean: remove_build_cache = args.force > 0 remove_package_cache = args.force > 1 - prefix = config.output if args.force > 1 else config.output_with_version else: remove_build_cache = args.force > 1 remove_package_cache = args.force > 2 - prefix = config.output if args.force > 2 else config.output_with_version with complete_step("Removing output files…"): if config.output_dir_or_cwd().exists(): for p in config.output_dir_or_cwd().iterdir(): - if p.name.startswith(prefix): + if p.name.startswith(config.output): rmtree(p) if remove_build_cache: