aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bpkg/pkg-build.cxx10
1 files 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 [[<packages>]@]<location> spec.
+ // Expand the [[<packages>]@]<location> 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<repository> r (
- db.load<repository> (ps.location.canonical_name ()));
+ db.find<repository> (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