diff options
| author | Julian Andres Klode <jak@debian.org> | 2025-07-22 19:58:14 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2025-08-26 13:41:35 +0200 |
| commit | db78e2f8eafb1009bd47e488fc39d8b420f4c749 (patch) | |
| tree | 2e56f81714e94389463615269e84b8e889374c8d /test/integration/test-resolver-prefers-real-package | |
| parent | e7ad79fddc6aa46b8f5efce890928db47be7b48b (diff) | |
solver3: Sort dependency targets against current alternative
Instead of inadvertently sorting dependency targets against
the first alternative in an or group, sort them against the
current alternative as we should.
Otherwise we ended up sorting
gnome-shell | notification-daemon
With
Package: notification-daemon
Package: awesome
Provides: notification-daemon
into
gnome-shell | awesome | notification-daemon
<-we sorted this part wrongly->
This fixes a minor difference in test-release-candidate-switching
in one case, but not the other where the difference was actually
caused by the loss of install argument ordering information in
the new solver, so just flip the arguments so both solvers produce
the same outcome.
Diffstat (limited to 'test/integration/test-resolver-prefers-real-package')
| -rwxr-xr-x | test/integration/test-resolver-prefers-real-package | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/test/integration/test-resolver-prefers-real-package b/test/integration/test-resolver-prefers-real-package new file mode 100755 index 000000000..d692eb0be --- /dev/null +++ b/test/integration/test-resolver-prefers-real-package @@ -0,0 +1,58 @@ +#!/bin/sh +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" +setupenvironment +configarchitecture 'amd64' + +insertpackage 'unstable' 'update-notifier' 'all' '1' 'Depends: gnome-shell | notification-daemon' +insertpackage 'unstable' 'gnome-shell' 'all' '1' 'Provides: notification-daemon' + +# The classic solver prefers the last entry in the Packages file, whereas solver3 goes alphabetically +insertpackage 'unstable' 'cinnamon' 'all' '1' 'Provides: notification-daemon' +insertpackage 'unstable' 'awesome' 'all' '1' 'Provides: notification-daemon' +insertpackage 'unstable' 'notification-daemon' 'all' '1' + +setupaptarchive + +# Forbid more and more preferred choices to inspect the ordering the solver chooses + +testsuccessequal "Reading package lists... +Building dependency tree... +The following additional packages will be installed: + gnome-shell +The following NEW packages will be installed: + gnome-shell update-notifier +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst gnome-shell (1 unstable [all]) +Inst update-notifier (1 unstable [all]) +Conf gnome-shell (1 unstable [all]) +Conf update-notifier (1 unstable [all])" apt install update-notifier -s + +testsuccessequal "Reading package lists... +Building dependency tree... +Package 'gnome-shell' is not installed, so not removed +The following additional packages will be installed: + notification-daemon +The following NEW packages will be installed: + notification-daemon update-notifier +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst notification-daemon (1 unstable [all]) +Inst update-notifier (1 unstable [all]) +Conf notification-daemon (1 unstable [all]) +Conf update-notifier (1 unstable [all])" apt install update-notifier gnome-shell- -s + +testsuccessequal "Reading package lists... +Building dependency tree... +Package 'gnome-shell' is not installed, so not removed +Package 'notification-daemon' is not installed, so not removed +The following additional packages will be installed: + awesome +The following NEW packages will be installed: + awesome update-notifier +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst awesome (1 unstable [all]) +Inst update-notifier (1 unstable [all]) +Conf awesome (1 unstable [all]) +Conf update-notifier (1 unstable [all])" apt install update-notifier gnome-shell- notification-daemon- -s |
