]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Never clean output directory when Format=none
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 30 Oct 2024 09:38:05 +0000 (10:38 +0100)
committerJörg Behrmann <behrmann@physik.fu-berlin.de>
Wed, 30 Oct 2024 13:07:57 +0000 (14:07 +0100)
If Format=none no outputs can be produced at all so let's make sure
we always keep the previous outputs intact when Format=none regardless
of whether -f is specified or not.

mkosi/__init__.py

index 6968b80ef25cb3da381457160bad02bc5214725c..435910aabbc2df145907be17bfa05ea5d3eef3e5 100644 (file)
@@ -4242,7 +4242,7 @@ def run_clean(args: Args, config: Config, *, resources: Path) -> None:
         remove_image_cache = args.force > 0
         remove_package_cache = args.force > 1
     else:
-        remove_output_dir = config.output_format != OutputFormat.none or args.force > 0
+        remove_output_dir = config.output_format != OutputFormat.none and args.force > 0
         remove_build_cache = args.force > 1 or args.wipe_build_dir
         remove_image_cache = args.force > 1 or not have_cache(config)
         remove_package_cache = args.force > 2