aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2022-10-12 12:50:17 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2022-10-12 12:50:17 +0300
commit33b205cde8bff7828228610b57adbe99fa7fe408 (patch)
tree863fe67c7e28806f10d6cdd2af71bb0378419bd4
parent4d2d1a5b0abc4ef543b9d4aa79dc6891ca8b7155 (diff)
Fix package skeleton bootstrap crash for configuration with uninitialized tmp dir
-rw-r--r--bpkg/package-skeleton.cxx16
1 files changed, 14 insertions, 2 deletions
diff --git a/bpkg/package-skeleton.cxx b/bpkg/package-skeleton.cxx
index fee4bbc..48de2d0 100644
--- a/bpkg/package-skeleton.cxx
+++ b/bpkg/package-skeleton.cxx
@@ -2488,8 +2488,20 @@ namespace bpkg
//
assert (skl.out_root_.empty ());
- auto i (tmp_dirs.find (skl.db_->config_orig));
- assert (i != tmp_dirs.end ());
+ // Note that only configurations which can be used as repository
+ // information sources has the temporary directory facility
+ // pre-initialized (see pkg-build.cxx for details). Thus, we may need
+ // to initialize it ourselves.
+ //
+ const dir_path& c (skl.db_->config_orig);
+ auto i (tmp_dirs.find (c));
+
+ if (i == tmp_dirs.end ())
+ {
+ init_tmp (c);
+
+ i = tmp_dirs.find (c);
+ }
// Make sure the source and out root directories, if set, are absolute
// and normalized.