From b02cdd9b35a1a494c268f652ea1a46feec263e1e Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 11 Feb 2025 19:03:40 +0100 Subject: solver3: Promote various Recommends to Depends Already satisfied Recommends should be promoted to Depends; as well as Recommends that are new, if the version they are from is an upgrade (such that upgrading does not introduce unsat Recommends). This only works for the case where the new Recommends actually exist; test-resolve-by-keep-new-recommends is not yet implemented, but this means the phasing tests will behave correctly. --- apt-pkg/solver3.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'apt-pkg/solver3.cc') diff --git a/apt-pkg/solver3.cc b/apt-pkg/solver3.cc index 0ece03b63..38c3e8f4a 100644 --- a/apt-pkg/solver3.cc +++ b/apt-pkg/solver3.cc @@ -599,6 +599,18 @@ APT::Solver::Clause APT::Solver::TranslateOrGroup(pkgCache::DepIterator start, p std::cerr << "Promoting satisfied Suggests to Recommends: " << clause.toString(cache) << std::endl; important = true; } + else if (satisfied && important && wasImportant && clause.solutions.size() > 0) + { + if (unlikely(debug >= 3)) + std::cerr << "Promoting existing Recommends " << clause.toString(cache) << " to depends in upgrade" << std::endl; + clause.optional = false; + } + else if (newOptional && important && reason.Ver() && clause.solutions.size() > 0 && reason.Ver(cache) != reason.CastPkg(cache).CurrentVer() && IsUpgrade) + { + if (unlikely(debug >= 3)) + std::cerr << "Promoting new Recommends " << clause.toString(cache) << " to depends in upgrade" << std::endl; + clause.optional = false; + } else if (not important) { if (unlikely(debug >= 3)) -- cgit v1.2.3-70-g09d2