From db78e2f8eafb1009bd47e488fc39d8b420f4c749 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 22 Jul 2025 19:58:14 +0200 Subject: solver3: Sort dependency targets against current alternative Instead of inadvertently sorting dependency targets against the first alternative in an or group, sort them against the current alternative as we should. Otherwise we ended up sorting gnome-shell | notification-daemon With Package: notification-daemon Package: awesome Provides: notification-daemon into gnome-shell | awesome | notification-daemon <-we sorted this part wrongly-> This fixes a minor difference in test-release-candidate-switching in one case, but not the other where the difference was actually caused by the loss of install argument ordering information in the new solver, so just flip the arguments so both solvers produce the same outcome. --- apt-pkg/solver3.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/solver3.cc b/apt-pkg/solver3.cc index c2877946c..2c381f098 100644 --- a/apt-pkg/solver3.cc +++ b/apt-pkg/solver3.cc @@ -843,8 +843,6 @@ void APT::Solver::RegisterCommonDependencies(pkgCache::PkgIterator Pkg) APT::Solver::Clause APT::Solver::TranslateOrGroup(pkgCache::DepIterator start, pkgCache::DepIterator end, Var reason) { - auto TgtPkg = start.TargetPkg(); - // Non-important dependencies can only be installed if they are currently satisfied, see the check further // below once we have calculated all possible solutions. if (start.ParentPkg()->CurrentVer == 0 && not policy.IsImportantDep(start)) @@ -880,8 +878,7 @@ APT::Solver::Clause APT::Solver::TranslateOrGroup(pkgCache::DepIterator start, p clause.solutions.push_back(Var(pkgCache::VerIterator(cache, *tgt))); } delete[] all; - - std::stable_sort(clause.solutions.begin() + begin, clause.solutions.end(), CompareProviders3{cache, policy, TgtPkg, *this}); + std::stable_sort(clause.solutions.begin() + begin, clause.solutions.end(), CompareProviders3{cache, policy, start.TargetPkg(), *this}); } if (start == end) break; -- cgit v1.2.3-70-g09d2