From 86c44166b470ecee5a192ffb434fb7931b7c0afd Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 27 May 2025 14:24:09 +0200 Subject: solver3: Merge Depends into Recommends Merge any hard clauses into optional clauses, such that optional clauses don't end up with more choices. For example if you have Depends: a | b Recommends: a | c This becomes: Depends: a | b Recommends: a We have simulated this with the chaos-actor in the test case and a Depends: git (not satisfied by chaos provider) Recommends: git (satisfied by chaos provider) and the latter constraint is limited to the former. --- .../test-ubuntu-bug-2111792-intersecting-dependencies | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test') diff --git a/test/integration/test-ubuntu-bug-2111792-intersecting-dependencies b/test/integration/test-ubuntu-bug-2111792-intersecting-dependencies index 4f58893bf..86866b233 100755 --- a/test/integration/test-ubuntu-bug-2111792-intersecting-dependencies +++ b/test/integration/test-ubuntu-bug-2111792-intersecting-dependencies @@ -20,6 +20,8 @@ insertinstalledpackage 'git-cvs' 'amd64' '1:2.25.1-1' 'Depends: git (>> 1:2.25.1 insertpackage 'unstable' 'git' 'amd64,i386' '1:2.26.2-1' 'Multi-Arch: foreign' insertpackage 'unstable' 'git-cvs' 'amd64,i386' '1:2.26.2-1' 'Depends: git (>> 1:2.26.2), git (<< 1:2.26.2-.)' insertpackage 'unstable' 'git-ng' 'amd64,i386' '1:2.26.2-1' 'Depends: git (>> 1:2.26.2), git (<< 1:2.26.2-.)' +insertpackage 'unstable' 'git-rec-ng' 'amd64,i386' '1:2.26.2-1' 'Recommends: git (>> 1:2.26.2) +Depends: git (<< 1:2.26.2-.)' insertpackage 'unstable' 'chaos-actor' 'amd64,i386' '1' 'Provides: git (2:1)' setupaptarchive @@ -165,3 +167,14 @@ E: Unable to satisfy dependencies. Reached two conflicting decisions: 1. git:amd64=1:2.25.1-1 is selected for install as above 2. git:amd64 Conflicts git:i386' apt install git-ng -s +# The Recommends: git (>> 1:2.26.2-1) will be left unsatisfied rather than pulling in chaos-actor. +testsuccessequal 'Reading package lists... +Building dependency tree... +Solving dependencies... +Recommended packages: + git +The following NEW packages will be installed: + git-rec-ng +0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded. +Inst git-rec-ng (1:2.26.2-1 unstable [amd64]) +Conf git-rec-ng (1:2.26.2-1 unstable [amd64])' apt install git-rec-ng -s -- cgit v1.2.3-70-g09d2