diff options
| author | Julian Andres Klode <jak@debian.org> | 2025-03-20 21:44:05 +0000 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2025-03-20 21:44:05 +0000 |
| commit | fbb202b34df162eb19e9035683800e704cd17e6a (patch) | |
| tree | 4601ec604e90b2513d8b80278861fee29c76f0a5 /apt-pkg/solver3.cc | |
| parent | fff3dddedba0d19d722cb4889bab355182cc2522 (diff) | |
| parent | 81804cefd8c24c98e7a0216a9d4277516e19b6e2 (diff) | |
Merge branch 'solver3' into 'main'
solver3: Handle previously satisfied Suggests last
See merge request apt-team/apt!467
Diffstat (limited to 'apt-pkg/solver3.cc')
| -rw-r--r-- | apt-pkg/solver3.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/apt-pkg/solver3.cc b/apt-pkg/solver3.cc index 4d988b523..620156ac3 100644 --- a/apt-pkg/solver3.cc +++ b/apt-pkg/solver3.cc @@ -861,6 +861,12 @@ APT::Solver::Clause APT::Solver::TranslateOrGroup(pkgCache::DepIterator start, p { if (unlikely(debug >= 3)) std::cerr << "Try to keep satisfied: " << clause.toString(cache, true) << std::endl; + clause.group = Group::SatisfySuggests; + // Erase the non-installed solutions. We will process this last and try to keep the previously installed + // "best" solution installed. + clause.solutions.erase(std::remove_if(clause.solutions.begin(), clause.solutions.end(), [this](auto var) + { return var.CastPkg(cache)->CurrentVer == nullptr; }), + clause.solutions.end()); } else if (not important) { |
