From eab6596f3b29a24552a51ca44ed2e00b246f041c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 20 Mar 2018 14:34:59 +0200 Subject: Cleanup destination directory on dist failure --- build2/dist/operation.cxx | 3 +++ 1 file changed, 3 insertions(+) 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"]) -- cgit v1.1