From 0e954df70c6133d84660ee446fdb33ecb61a8c3f Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 4 Feb 2022 11:46:14 +0300 Subject: Improve pkg-build's make_available() function --- bpkg/pkg-build.cxx | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/bpkg/pkg-build.cxx b/bpkg/pkg-build.cxx index a697fb0..02e4253 100644 --- a/bpkg/pkg-build.cxx +++ b/bpkg/pkg-build.cxx @@ -403,9 +403,23 @@ namespace bpkg // root repository fragment but that feels a bit too drastic at the // moment). // - shared_ptr af ( - db.find ( - sp->repository_fragment.canonical_name ())); + // Also note that the repository information for this selected package can + // potentially be in one of the ultimate dependent configurations as + // determined at the time of the run when the package was configured. This + // configurations set may differ from the current one, but let's try + // anyway. + // + lazy_shared_ptr rf; + + for (database& ddb: dependent_repo_configs (db)) + { + if (shared_ptr f = ddb.find ( + sp->repository_fragment.canonical_name ())) + { + rf = lazy_shared_ptr (ddb, move (f)); + break; + } + } // The package is in at least fetched state, which means we should // be able to get its manifest. @@ -426,10 +440,7 @@ namespace bpkg // Copy potentially fixed up version from selected package. [&sp] (version& v) {v = sp->version;})); - return make_pair (make_shared (move (m)), - (af != nullptr - ? lazy_shared_ptr (db, move (af)) - : nullptr)); + return make_pair (make_shared (move (m)), move (rf)); } // Return true if the version constraint represents the wildcard version. -- cgit v1.1