From b636668788fe8b1f7183b21eaf7b87f34209169e Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 1 Jul 2024 16:27:15 +0200 Subject: solver3: Do not accidentally promote Replaces and Enhances to dependencies As part of the refactoring, we allowed the code to work on unimportant dependencies as we needed to promote Suggests to Depends if they are currently satisfied. However, Replaces and Enhances were not considered properly and both are not negative dependencies so they were accidentally promoted to Depends too if they were currently satisfied. --- apt-pkg/solver3.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'apt-pkg/solver3.cc') diff --git a/apt-pkg/solver3.cc b/apt-pkg/solver3.cc index dc70adbde..f94fa6736 100644 --- a/apt-pkg/solver3.cc +++ b/apt-pkg/solver3.cc @@ -480,7 +480,9 @@ bool APT::Solver::EnqueueOrGroup(pkgCache::DepIterator start, pkgCache::DepItera // below once we have calculated all possible solutions. if (start.ParentPkg()->CurrentVer == 0 && not policy.IsImportantDep(start)) return true; - + // Replaces and Enhances are not a real dependency. + if (start->Type == pkgCache::Dep::Replaces || start->Type == pkgCache::Dep::Enhances) + return true; if (unlikely(debug >= 3)) std::cerr << "Found dependency critical " << Ver.ParentPkg().FullName() << "=" << Ver.VerStr() << " -> " << start.TargetPkg().FullName() << "\n"; -- cgit v1.2.3-70-g09d2