diff options
| author | Julian Andres Klode <jak@debian.org> | 2025-07-22 19:58:14 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2025-08-26 13:41:35 +0200 |
| commit | db78e2f8eafb1009bd47e488fc39d8b420f4c749 (patch) | |
| tree | 2e56f81714e94389463615269e84b8e889374c8d /apt-pkg/solver3.cc | |
| parent | e7ad79fddc6aa46b8f5efce890928db47be7b48b (diff) | |
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.
Diffstat (limited to 'apt-pkg/solver3.cc')
| -rw-r--r-- | apt-pkg/solver3.cc | 5 |
1 files changed, 1 insertions, 4 deletions
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; |
