diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2021-07-29 18:32:14 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2021-07-30 11:04:37 +0300 |
commit | 7490948f27d70df1f88ed161a2b758755d0a7929 (patch) | |
tree | 464099162afbf339c6cb502ba38d84ae0f9ced1e /bpkg/utility.cxx | |
parent | aaf8e696886f443cd095ca7a5f37fc5b1ce0e207 (diff) |
Add support for checked out repository fragments caching
Diffstat (limited to 'bpkg/utility.cxx')
-rw-r--r-- | bpkg/utility.cxx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/bpkg/utility.cxx b/bpkg/utility.cxx index 40ae02c..b179f63 100644 --- a/bpkg/utility.cxx +++ b/bpkg/utility.cxx @@ -255,8 +255,8 @@ namespace bpkg } } - void - mv (const dir_path& from, const dir_path& to) + bool + mv (const dir_path& from, const dir_path& to, bool ie) { if (verb >= 3) text << "mv " << from << ' ' << to; // Prints trailing slashes. @@ -267,8 +267,16 @@ namespace bpkg } catch (const system_error& e) { - fail << "unable to move directory " << from << " to " << to << ": " << e; + error << "unable to move directory " << from << " to " << to << ": " + << e; + + if (ie) + return false; + + throw failed (); } + + return true; } dir_path |