summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2025-03-07 11:20:18 +0100
committerJulian Andres Klode <julian.klode@canonical.com>2025-03-07 11:24:39 +0100
commit8d8d8441f0a4974cb48bbc08a0a175886d569b1d (patch)
tree83eef41eda79f19763817a2b20ad615d4c31b438
parent142d6499b51451d57fc050c71ffcfb8338e02b7e (diff)
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.
-rw-r--r--apt-pkg/solver3.cc6
1 files changed, 5 insertions, 1 deletions
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;
}