aboutsummaryrefslogtreecommitdiff
path: root/bpkg/utility.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-01-16 10:29:18 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-01-16 10:29:18 +0200
commitce76d4774a9e9d6b6c57d2c21f45f289eedccd56 (patch)
treefed7459fbf40e14f6297d1911c39e0daf3a43f27 /bpkg/utility.hxx
parente2d59d4a05b7624570c6398b3a6d095138d0d241 (diff)
Use tmp directory facility for storing temporary certificates
Diffstat (limited to 'bpkg/utility.hxx')
-rw-r--r--bpkg/utility.hxx16
1 files changed, 11 insertions, 5 deletions
diff --git a/bpkg/utility.hxx b/bpkg/utility.hxx
index e56e093..f4f8690 100644
--- a/bpkg/utility.hxx
+++ b/bpkg/utility.hxx
@@ -39,6 +39,11 @@ namespace bpkg
using butl::exception_guard;
using butl::make_exception_guard;
+ // <libbutl/filesystem.mxx>
+ //
+ using butl::auto_rmfile;
+ using butl::auto_rmdir;
+
// Empty string and path.
//
extern const string empty_string;
@@ -50,7 +55,7 @@ namespace bpkg
extern const dir_path bpkg_dir; // .bpkg/
extern const dir_path certs_dir; // .bpkg/certs/
- // Temporary directory.
+ // 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
@@ -58,7 +63,11 @@ namespace bpkg
// you don't need to call init_tmp() explicitly except for certain special
// commands (like cfg-create).
//
- extern dir_path tmp_dir;
+ auto_rmfile
+ tmp_file (const string& prefix);
+
+ auto_rmdir
+ tmp_dir (const string& prefix);
void
init_tmp (const dir_path& cfg);
@@ -100,9 +109,6 @@ namespace bpkg
uint16_t verbosity = 3,
bool ignore_error = false);
- using auto_rm = butl::auto_rmfile;
- using auto_rm_r = butl::auto_rmdir;
-
// Process.
//
// By default the process command line is printed for verbosity >= 2