From 7490948f27d70df1f88ed161a2b758755d0a7929 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 29 Jul 2021 18:32:14 +0300 Subject: Add support for checked out repository fragments caching --- bpkg/utility.cxx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'bpkg/utility.cxx') 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 -- cgit v1.1