diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2023-02-01 14:32:04 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2023-02-01 14:32:04 +0200 |
commit | d956e69e8b55dc2248b902490a138a46f02f9e55 (patch) | |
tree | 3b1c0021597c10402d7c89a4f095760f73a54aa0 /bpkg/pkg-build.cxx | |
parent | 546391dab6173660acceba6404136e9411ce1388 (diff) |
Add --sys-no-stub bpkg-pkg-build option to allow sys: packages without stubs
Diffstat (limited to 'bpkg/pkg-build.cxx')
-rw-r--r-- | bpkg/pkg-build.cxx | 16 |
1 files changed, 13 insertions, 3 deletions
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<available_package> (nm)); + } } // This covers both our diagnostics below as well as anything that |