diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2021-09-03 18:24:08 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2021-09-04 12:40:57 +0300 |
commit | 7bb44980ced46506c10bad333f526b7bc62ea1db (patch) | |
tree | 207a14ee727f7237e8fc2b08e47f4de8a97e0b99 /bpkg/rep-remove.cxx | |
parent | bd02eaa1298271ecf8365aa869e93fdcb04fdeb1 (diff) |
Add support for multiple temporary directories
Diffstat (limited to 'bpkg/rep-remove.cxx')
-rw-r--r-- | bpkg/rep-remove.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
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<dir_path> (de.path ())); + rmdir (db.config_orig, rd / path_cast<dir_path> (de.path ())); } } catch (const system_error& e) |