From: Daan De Meyer Date: Mon, 28 Oct 2024 20:19:28 +0000 (+0100) Subject: Only run clean scripts when we clean up the output directory X-Git-Tag: v25~200^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8c34eef21e4430ed3a6503b285154fe8817cfa7;p=thirdparty%2Fmkosi.git Only run clean scripts when we clean up the output directory 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. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 6f6690dd2..3c5418e99 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -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 (