aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-03-20 14:34:59 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-03-20 14:34:59 +0200
commiteab6596f3b29a24552a51ca44ed2e00b246f041c (patch)
treef5226e1fab3e8d9090225dcb48c3a215058439db
parent10ec1ac16b5ec2577b94e8311e48ee3c7db9fb78 (diff)
Cleanup destination directory on dist failure
-rw-r--r--build2/dist/operation.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/build2/dist/operation.cxx b/build2/dist/operation.cxx
index ff0c0d5..612edc8 100644
--- a/build2/dist/operation.cxx
+++ b/build2/dist/operation.cxx
@@ -323,6 +323,7 @@ namespace build2
if (build2::rmdir_r (td, true, 2) == rmdir_status::not_empty)
fail << "unable to clean target directory " << td;
+ auto_rmdir rm_td (td); // Clean it up if things go bad.
install (dist_cmd, td);
// Copy over all the files. Apply post-processing callbacks.
@@ -421,6 +422,8 @@ namespace build2
diag_progress.clear ();
}
+ rm_td.cancel ();
+
// Archive if requested.
//
if (auto l = rs->vars["dist.archives"])