From 6a4f560e4e3f9a09dc6643e3ee90088e00afb6ca Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 22 Dec 2016 16:26:02 +0100 Subject: [PATCH] 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. --- mkosi | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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) -- 2.47.2