From f492f67ced0db166bb9e0840252be616c5be0f67 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 9 Jul 2018 21:06:42 +0300 Subject: Fix pkg-build crash for @ spec in presense of --no-fetch option --- bpkg/pkg-build.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bpkg/pkg-build.cxx b/bpkg/pkg-build.cxx index a4cbe7f..0793195 100644 --- a/bpkg/pkg-build.cxx +++ b/bpkg/pkg-build.cxx @@ -2514,10 +2514,16 @@ namespace bpkg continue; } - // Expand the [[]@] spec. + // Expand the [[]@] spec. Fail if the repository + // is not found in this configuration, that can be the case in the + // presence of --no-fetch option. // shared_ptr r ( - db.load (ps.location.canonical_name ())); + db.find (ps.location.canonical_name ())); + + if (r == nullptr) + fail << "repository '" << ps.location + << "' does not exist in this configuration"; // If no packages are specified explicitly (the argument starts with // '@' or is a URL) then we select latest versions of all the packages -- cgit