From: Daan De Meyer Date: Fri, 21 Apr 2023 10:25:01 +0000 (+0200) Subject: Empty install directory before running build script X-Git-Tag: v15~223 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=02a82be114cce8e05ce4efcbd0854a94e27edc61;p=thirdparty%2Fmkosi.git Empty install directory before running build script The install directory is shared between distros, and depending on the distro, different files might be installed. Let's make sure we empty the install directory before running the build so that files from different distros don't end up mixed in the install directory. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index aa15cf0a9..a026b31b9 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -1801,6 +1801,10 @@ def run_build_script(state: MkosiState) -> None: if state.config.build_script is None or state.for_cache: return + # Make sure that if mkosi.installdir/ is used, any leftover files from a previous run are removed. + if state.config.install_dir: + empty_directory(state.config.install_dir) + with complete_step("Running build script…"), mount_build_overlay(state, read_only=True): bwrap: list[PathString] = [ "--bind", state.config.build_sources, "/work/src",