From d956e69e8b55dc2248b902490a138a46f02f9e55 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 1 Feb 2023 14:32:04 +0200 Subject: Add --sys-no-stub bpkg-pkg-build option to allow sys: packages without stubs --- bpkg/pkg-build.cxx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'bpkg/pkg-build.cxx') diff --git a/bpkg/pkg-build.cxx b/bpkg/pkg-build.cxx index 4d90df2..9e5e1bb 100644 --- a/bpkg/pkg-build.cxx +++ b/bpkg/pkg-build.cxx @@ -1714,11 +1714,21 @@ namespace bpkg aps = find_available_all (current_configs, nm); // If no source/stub for the package (and thus no mapping), issue - // diagnostics consistent with other such places. + // diagnostics consistent with other such places unless explicitly + // allowed by the user. // if (aps.empty ()) - fail << "unknown package " << nm << - info << "consider specifying " << nm << "/*"; + { + if (!o.sys_no_stub ()) + fail << "unknown package " << nm << + info << "consider specifying --sys-no-stub or " << nm << "/*"; + + // Add the stub package to the imaginary system repository (like + // the user-specified case below). + // + if (stubs != nullptr) + stubs->push_back (make_shared (nm)); + } } // This covers both our diagnostics below as well as anything that -- cgit v1.1