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/utility.hxx | |
parent | bd02eaa1298271ecf8365aa869e93fdcb04fdeb1 (diff) |
Add support for multiple temporary directories
Diffstat (limited to 'bpkg/utility.hxx')
-rw-r--r-- | bpkg/utility.hxx | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/bpkg/utility.hxx b/bpkg/utility.hxx index ce6120f..dabffbe 100644 --- a/bpkg/utility.hxx +++ b/bpkg/utility.hxx @@ -4,6 +4,7 @@ #ifndef BPKG_UTILITY_HXX #define BPKG_UTILITY_HXX +#include <map> #include <memory> // make_shared() #include <string> // to_string() #include <cstring> // strcmp(), strchr() @@ -83,19 +84,20 @@ namespace bpkg // Temporary directory facility. // - // This is normally .bpkg/tmp/ but can also be some system-wide directory - // (e.g., /tmp/bpkg-XXX/) if there is no bpkg configuration. This directory - // is automatically created and cleaned up for most commands in main() so - // you don't need to call init_tmp() explicitly except for certain special - // commands (like cfg-create). + // An entry normally maps <cfg-dir> to <cfg-dir>/.bpkg/tmp/ but can also map + // an empty directory to some system-wide directory (e.g., /tmp/bpkg-XXX/) + // if there is no bpkg configuration. The temporary directory for the + // current configuration is automatically created and cleaned up for most + // commands in main(), so you don't need to call init_tmp() explicitly + // except for certain special commands (like cfg-create). // - extern dir_path temp_dir; + extern std::map<dir_path, dir_path> temp_dir; auto_rmfile - tmp_file (const string& prefix); + tmp_file (const dir_path& cfg, const string& prefix); auto_rmdir - tmp_dir (const string& prefix); + tmp_dir (const dir_path& cfg, const string& prefix); void init_tmp (const dir_path& cfg); |