diff options
| author | Julian Andres Klode <julian.klode@canonical.com> | 2025-03-07 11:20:18 +0100 |
|---|---|---|
| committer | Julian Andres Klode <julian.klode@canonical.com> | 2025-03-07 11:24:39 +0100 |
| commit | 8d8d8441f0a4974cb48bbc08a0a175886d569b1d (patch) | |
| tree | 83eef41eda79f19763817a2b20ad615d4c31b438 /apt-pkg | |
| parent | 142d6499b51451d57fc050c71ffcfb8338e02b7e (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.
Diffstat (limited to 'apt-pkg')
| -rw-r--r-- | apt-pkg/solver3.cc | 6 |
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; } |
