diff options
Diffstat (limited to 'apt-pkg')
| -rw-r--r-- | apt-pkg/solver3.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/apt-pkg/solver3.cc b/apt-pkg/solver3.cc index 052142658..c2877946c 100644 --- a/apt-pkg/solver3.cc +++ b/apt-pkg/solver3.cc @@ -964,6 +964,16 @@ APT::Solver::Clause APT::Solver::TranslateOrGroup(pkgCache::DepIterator start, p std::cerr << "Promoting new clause to hard dependency: " << clause.toString(cache) << std::endl; clause.optional = false; } + else if (not existing.end() && importantToKeep(start) && satisfied) + { + if (unlikely(debug >= 3)) + std::cerr << "Restricting existing Recommends to installed packages: " << clause.toString(cache, true) << std::endl; + // 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()); + } } return clause; |
