From 7bb44980ced46506c10bad333f526b7bc62ea1db Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 3 Sep 2021 18:24:08 +0300 Subject: Add support for multiple temporary directories --- bpkg/rep-remove.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'bpkg/rep-remove.cxx') diff --git a/bpkg/rep-remove.cxx b/bpkg/rep-remove.cxx index 266d70c..5dab94b 100644 --- a/bpkg/rep-remove.cxx +++ b/bpkg/rep-remove.cxx @@ -129,9 +129,12 @@ namespace bpkg // the chances for the operation to succeed. // static void - rmdir (const dir_path& d) + rmdir (const dir_path& cfg, const dir_path& d) { - dir_path td (temp_dir / d.leaf ()); + auto i (temp_dir.find (cfg)); + assert (i != temp_dir.end ()); + + dir_path td (i->second / d.leaf ()); if (exists (td)) rm_r (td); @@ -210,7 +213,7 @@ namespace bpkg } if (rm) - rmdir (sd); + rmdir (db.config_orig, sd); } } } @@ -336,7 +339,7 @@ namespace bpkg for (const dir_entry& de: dir_iterator (rd, false /* ignore_dangling */)) { if (de.ltype () == entry_type::directory) - rmdir (rd / path_cast (de.path ())); + rmdir (db.config_orig, rd / path_cast (de.path ())); } } catch (const system_error& e) -- cgit v1.1