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/utility.hxx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'bpkg/utility.hxx') 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 #include // make_shared() #include // to_string() #include // 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 to /.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 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); -- cgit v1.1