summaryrefslogtreecommitdiff
path: root/apt-pkg/solver3.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2024-05-21 16:57:56 +0200
committerJulian Andres Klode <julian.klode@canonical.com>2024-05-24 17:01:55 +0200
commitaaa9e415ce48964726401462767d6038da6d82e7 (patch)
tree0d2792abbdb4920fb0caa26a5ff12d84f09db55d /apt-pkg/solver3.cc
parent808f51e800a9d6a834723fe1d1fdff98ee14d7b5 (diff)
solver3: Actually restore unsolved items rather than solved ones
When restoring previously solved items, we try to restore items that have become unsolved again by skipping items that have a solved solution. Well at least we thought we did, but we accidentally had a "not" in there that inverted the meaning, hence we lost work items on backtracking. This mostly did not seem to have caused any issues, I stumbled over it while trying to add `autoremove` listings to `upgrade`, but fixing it also fixes: test-ubuntu-bug-1130419-prefer-installed-ma-same-siblings This used to say "E: Broken packages", meaning the solver lost a non-optional install request and the 2nd stage solver caught an incomplete solution. Also test-bug-735967-lib32-to-i386-unavailable restores the legacy solver behavior, so win win?
Diffstat (limited to 'apt-pkg/solver3.cc')
-rw-r--r--apt-pkg/solver3.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/apt-pkg/solver3.cc b/apt-pkg/solver3.cc
index e16a02684..d5811423d 100644
--- a/apt-pkg/solver3.cc
+++ b/apt-pkg/solver3.cc
@@ -710,7 +710,7 @@ bool APT::Solver::Pop()
if (w.depth > depth) // Deeper decision level is no longer valid.
return true;
// This item is still solved, keep it on the solved list.
- if (not std::any_of(w.solutions.begin(), w.solutions.end(), [this](auto ver)
+ if (std::any_of(w.solutions.begin(), w.solutions.end(), [this](auto ver)
{ return (*this)[ver].decision == Decision::MUST; }))
return false;
// We are not longer solved, move it back to work.