aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2022-03-23 19:07:59 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2022-03-28 10:37:23 +0300
commitcd736d2602aae5502cbc86d5672505c2d534c79f (patch)
tree2d55b6d0d10171f48e19fb9564d7535d51524245
parentfdaa71c503c04aa35230b7f932f9ad43cc994a08 (diff)
Fix reconfiguring dependents in pkg-build
-rw-r--r--bpkg/pkg-build.cxx26
1 files changed, 20 insertions, 6 deletions
diff --git a/bpkg/pkg-build.cxx b/bpkg/pkg-build.cxx
index 60674b6..4821099 100644
--- a/bpkg/pkg-build.cxx
+++ b/bpkg/pkg-build.cxx
@@ -8238,13 +8238,27 @@ namespace bpkg
//
assert (sp->state == package_state::unpacked);
- // First try to find an existing available package for the selected
- // package and, if not found, create a transient one.
+ // First try to avoid the package manifest parsing, searching for an
+ // existing available package for the selected package and, if not
+ // found, create a transient one.
//
- shared_ptr<available_package> dap (
- find_available_one (dependent_repo_configs (pdb),
- sp->name,
- version_constraint (sp->version)).first);
+ // Note that we don't use find_available*() here since we don't care
+ // about the repository fragment the package comes from and only need
+ // its manifest information.
+ //
+ shared_ptr<available_package> dap;
+
+ available_package_id pid (sp->name, sp->version);
+ for (database& db: dependent_repo_configs (pdb))
+ {
+ shared_ptr<available_package> ap (db.find<available_package> (pid));
+
+ if (ap != nullptr && !ap->stub ())
+ {
+ dap = move (ap);
+ break;
+ }
+ }
if (dap == nullptr)
dap = make_available (o, pdb, sp);