From 8d8d8441f0a4974cb48bbc08a0a175886d569b1d Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 7 Mar 2025 11:20:18 +0100 Subject: solver3: bestReason: Only find actual assignments I marked exim4-daemon-light for install, which marked exim4-daemon-heavy for not install, but now in postfix Conflicts: mail-transport-agent we saw "not exim4-daemon-heavy" as the reason for not installing postfix. Oh noes. --- apt-pkg/solver3.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apt-pkg/solver3.cc b/apt-pkg/solver3.cc index d9ed1a7bb..3511132dd 100644 --- a/apt-pkg/solver3.cc +++ b/apt-pkg/solver3.cc @@ -273,8 +273,12 @@ inline APT::Solver::Var APT::Solver::bestReason(APT::Solver::Clause const *claus return Var{}; if (clause->reason == var) for (auto choice : clause->solutions) - if ((*this)[choice].decision != Decision::NONE) + { + if (clause->negative && (*this)[choice].decision == Decision::MUST) + return choice; + if (not clause->negative && (*this)[choice].decision == Decision::MUSTNOT) return choice; + } return clause->reason; } -- cgit v1.2.3-70-g09d2