From 7d0b6a067682f4e25343b95b28962b5d1828b8ba Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 12 Feb 2018 19:43:59 +0300 Subject: Fix init_tmp() not to fail if configuration directory is not a bpkg one --- bpkg/utility.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'bpkg/utility.cxx') diff --git a/bpkg/utility.cxx b/bpkg/utility.cxx index 75ba102..26716e8 100644 --- a/bpkg/utility.cxx +++ b/bpkg/utility.cxx @@ -47,10 +47,12 @@ namespace bpkg init_tmp (const dir_path& cfg) { // Whether the configuration is required or optional depends on the - // command so if the configuration directory does not exist, we simply - // create tmp in a system one and let the command complain if necessary. + // command so if the configuration directory does not exist or it is not a + // bpkg configuration directory, we simply create tmp in a system one and + // let the command complain if necessary. // - dir_path d (cfg.empty () || !exists (cfg, true /* ignore_error */) + dir_path d (cfg.empty () || + !exists (cfg / bpkg_dir, true /* ignore_error */) ? dir_path::temp_path ("bpkg") : cfg / bpkg_dir / dir_path ("tmp")); -- cgit v1.1