diff options
| -rw-r--r-- | apt-pkg/solver3.cc | 9 | ||||
| -rwxr-xr-x | test/integration/test-bug-735967-lib32-to-i386-unavailable | 8 |
2 files changed, 14 insertions, 3 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; diff --git a/test/integration/test-bug-735967-lib32-to-i386-unavailable b/test/integration/test-bug-735967-lib32-to-i386-unavailable index cc925d161..a44e58570 100755 --- a/test/integration/test-bug-735967-lib32-to-i386-unavailable +++ b/test/integration/test-bug-735967-lib32-to-i386-unavailable @@ -35,6 +35,12 @@ testsuccess aptget update testsuccessequal 'Reading package lists... Building dependency tree... Calculating upgrade... +The following packages have been kept back: + lib32nss-mdns libnss-mdns +0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.' aptget dist-upgrade -s --solver 3.0 +testsuccessequal 'Reading package lists... +Building dependency tree... +Calculating upgrade... The following packages will be REMOVED: lib32nss-mdns The following packages will be upgraded: @@ -42,7 +48,7 @@ The following packages will be upgraded: 1 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. Remv lib32nss-mdns [0.9-1] Inst libnss-mdns [0.9-1] (0.10-6 unstable [amd64]) -Conf libnss-mdns (0.10-6 unstable [amd64])' aptget dist-upgrade -s +Conf libnss-mdns (0.10-6 unstable [amd64])' aptget dist-upgrade -s --solver internal testfailuremsg 'E: Unsatisfiable dependency group libfoo:amd64=1 -> libfoo-bin:amd64' aptget install foo -s --solver 3.0 testfailureequal 'Reading package lists... |
