From: Lennart Poettering Date: Thu, 22 Dec 2016 15:26:02 +0000 (+0100) Subject: mkosi: properly remove root tree and /var/tmp between first and second build X-Git-Tag: v2~25^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F55%2Fhead;p=thirdparty%2Fmkosi.git mkosi: properly remove root tree and /var/tmp between first and second build Let's make sure to remove both the old OS tree and its /var/tmp file after the first build finished and we ran the build script inside of it, but before we start the next iteration. This fixes "-t directory" builds. --- diff --git a/mkosi b/mkosi index cc3fffcd3..3da363fab 100755 --- a/mkosi +++ b/mkosi @@ -2291,10 +2291,6 @@ def build_image(args, workspace, run_build_script): tar = make_tar(args, workspace.name, run_build_script) - # Remove the root directory again, if this is the build script build - if run_build_script: - unlink_try_hard(os.path.join(workspace.name, "root")) - return raw, tar, root_hash def var_tmp(workspace): @@ -2363,6 +2359,11 @@ def build_stuff(args): if tar is not None: del tar + if args.build_script is not None: + with complete_step("Removing artifacts from development build"): + unlink_try_hard(os.path.join(workspace.name, "root")) + unlink_try_hard(os.path.join(workspace.name, "var-tmp")) + raw, tar, root_hash = build_image(args, workspace, run_build_script=False) raw = xz_output(args, raw)