From ce76d4774a9e9d6b6c57d2c21f45f289eedccd56 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 16 Jan 2018 10:29:18 +0200 Subject: Use tmp directory facility for storing temporary certificates --- bpkg/utility.hxx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'bpkg/utility.hxx') 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; + // + // + 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 -- cgit v1.1