]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Only run clean scripts when we clean up the output directory
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 28 Oct 2024 20:19:28 +0000 (21:19 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 28 Oct 2024 20:19:28 +0000 (21:19 +0100)
Clean scripts are intended to clean up the output directory, so let's
only run them when we actually decide to clean up the output directory.

mkosi/__init__.py

index 6f6690dd2bbffb1c0e6ec377c85dc48ad6f38b37..3c5418e994e9748dd44a1dd4772e80ab259a468d 100644 (file)
@@ -4274,6 +4274,8 @@ def run_clean(args: Args, config: Config, *, resources: Path) -> None:
             ):
                 rmtree(*outputs, sandbox=sandbox)
 
+        run_clean_scripts(config)
+
     if (
         remove_build_cache
         and config.build_dir
@@ -4311,8 +4313,6 @@ def run_clean(args: Args, config: Config, *, resources: Path) -> None:
                 sandbox=sandbox,
             )
 
-    run_clean_scripts(config)
-
 
 def ensure_directories_exist(config: Config) -> None:
     for p in (