aboutsummaryrefslogtreecommitdiff
path: root/bpkg/pkg-build.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2023-10-31 22:12:53 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2023-11-02 14:04:09 +0300
commitf3ed48f053b8938c01a96f61c160e9a9c5f83562 (patch)
treeefabdf3371ea6fb5d218dc32203ef0f3447cd673 /bpkg/pkg-build.cxx
parent0370038a2c2e5fc575a543e2fbcf85a7c254283d (diff)
Fix pkg-build to order drops after collecting/ordering dependents when all reconfigurations are determined
Diffstat (limited to 'bpkg/pkg-build.cxx')
-rw-r--r--bpkg/pkg-build.cxx28
1 files changed, 23 insertions, 5 deletions
diff --git a/bpkg/pkg-build.cxx b/bpkg/pkg-build.cxx
index 857e66e..ede26bf 100644
--- a/bpkg/pkg-build.cxx
+++ b/bpkg/pkg-build.cxx
@@ -4553,11 +4553,19 @@ namespace bpkg
// dependencies between the specified packages).
//
// The order of dependency upgrades/downgrades/drops is not really
- // deterministic. We, however, do them before hold_pkgs so that they
- // appear (e.g., on the plan) last.
+ // deterministic. We, however, do upgrades/downgrades before hold_pkgs
+ // so that they appear (e.g., on the plan) last. We handle drops
+ // later, though, after collecting/ordering dependents when all the
+ // package reconfigurations are determined.
//
for (const dep& d: deps)
- pkgs.order (d.db, d.name, find_prereq_database, false /* reorder */);
+ {
+ if (d.available != nullptr)
+ pkgs.order (d.db,
+ d.name,
+ find_prereq_database,
+ false /* reorder */);
+ }
for (const build_package& p: reverse_iterate (hold_pkgs))
pkgs.order (p.db, p.name (), find_prereq_database);
@@ -4593,8 +4601,7 @@ namespace bpkg
//
pkgs.collect_order_dependents (rpt_depts, unsatisfied_depts);
- // And, finally, make sure all the packages that we need to unhold
- // are on the list.
+ // Make sure all the packages that we need to unhold are on the list.
//
for (const dependency_package& p: dep_pkgs)
{
@@ -4623,6 +4630,17 @@ namespace bpkg
}
}
+ // And, finally, order the package drops.
+ //
+ for (const dep& d: deps)
+ {
+ if (d.available == nullptr)
+ pkgs.order (d.db,
+ d.name,
+ find_prereq_database,
+ false /* reorder */);
+ }
+
// Make sure all the postponed dependencies of existing dependents
// have been collected and fail if that's not the case.
//