diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-03-20 14:34:59 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-03-20 14:34:59 +0200 |
commit | eab6596f3b29a24552a51ca44ed2e00b246f041c (patch) | |
tree | f5226e1fab3e8d9090225dcb48c3a215058439db /build2/dist/operation.cxx | |
parent | 10ec1ac16b5ec2577b94e8311e48ee3c7db9fb78 (diff) |
Cleanup destination directory on dist failure
Diffstat (limited to 'build2/dist/operation.cxx')
-rw-r--r-- | build2/dist/operation.cxx | 3 |
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"]) |