diff options
| author | Julian Andres Klode <julian.klode@canonical.com> | 2025-01-30 13:04:47 +0100 |
|---|---|---|
| committer | Julian Andres Klode <julian.klode@canonical.com> | 2025-01-30 14:50:15 +0100 |
| commit | a20242cf3a7321e78cfd4afd892d67255d8282ba (patch) | |
| tree | b4d666d0dcc651878e7d67e51606dea3c8f98997 /apt-pkg | |
| parent | 184ac78d3dd21b9d6c3b539703de803f0f7132a7 (diff) | |
solver3: Soft unit propagation for optional items
If both items are optional, unit items should be processed
first.
Diffstat (limited to 'apt-pkg')
| -rw-r--r-- | apt-pkg/solver3.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/apt-pkg/solver3.cc b/apt-pkg/solver3.cc index da80222e8..b876636c6 100644 --- a/apt-pkg/solver3.cc +++ b/apt-pkg/solver3.cc @@ -187,8 +187,13 @@ bool APT::Solver::Work::operator<(APT::Solver::Work const &b) const return not b.optional && b.size < 2; if (group != b.group) return group > b.group; - if (optional && b.optional && reason.empty() != b.reason.empty()) - return reason.empty(); + if (optional && b.optional) + { + if ((size < 2) != (b.size < 2)) + return b.size < 2; + if (reason.empty() != b.reason.empty()) + return reason.empty(); + } // An optional item is less important than a required one. if (optional != b.optional) return optional; |
