From 33b205cde8bff7828228610b57adbe99fa7fe408 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 12 Oct 2022 12:50:17 +0300 Subject: Fix package skeleton bootstrap crash for configuration with uninitialized tmp dir --- bpkg/package-skeleton.cxx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'bpkg') 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. -- cgit v1.1