summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2025-01-30 13:46:09 +0100
committerJulian Andres Klode <julian.klode@canonical.com>2025-01-30 14:50:15 +0100
commit45432cc57144715109f27d0bb83356b12e2a4ef5 (patch)
treeaa27f9354af7b5a63a1337b69496ff27e5079487
parenta20242cf3a7321e78cfd4afd892d67255d8282ba (diff)
solver3: Remove NewUnsatRecommends group
This is more or less unused; but it particularly has the bad problem of forcing new unsat recommends to be solved *before* dependencies. Which is awkward.
-rw-r--r--apt-pkg/solver3.cc2
-rw-r--r--apt-pkg/solver3.h1
-rwxr-xr-xtest/integration/test-solver-recommends-depends46
3 files changed, 46 insertions, 3 deletions
diff --git a/apt-pkg/solver3.cc b/apt-pkg/solver3.cc
index b876636c6..ce38d75d8 100644
--- a/apt-pkg/solver3.cc
+++ b/apt-pkg/solver3.cc
@@ -603,8 +603,6 @@ bool APT::Solver::EnqueueOrGroup(pkgCache::DepIterator start, pkgCache::DepItera
return true;
}
}
- else if (workItem.optional && start.ParentPkg()->CurrentVer == 0)
- workItem.group = Group::NewUnsatRecommends;
if (not workItem.solutions.empty())
{
diff --git a/apt-pkg/solver3.h b/apt-pkg/solver3.h
index a643d5d07..c7437f8fb 100644
--- a/apt-pkg/solver3.h
+++ b/apt-pkg/solver3.h
@@ -46,7 +46,6 @@ class Solver
enum class Group : uint8_t
{
HoldOrDelete,
- NewUnsatRecommends,
// Satisfying dependencies on entirely new packages first is a good idea because
// it may contain replacement packages like libfoo1t64 whereas we later will see
diff --git a/test/integration/test-solver-recommends-depends b/test/integration/test-solver-recommends-depends
new file mode 100755
index 000000000..90c5050a7
--- /dev/null
+++ b/test/integration/test-solver-recommends-depends
@@ -0,0 +1,46 @@
+#!/bin/sh
+set -e
+
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
+setupenvironment
+allowremovemanual
+configarchitecture 'amd64'
+
+insertpackage 'unstable' 'a' 'all' '2'
+insertpackage 'unstable' 'b' 'all' '2'
+insertpackage 'unstable' 'x' 'all' '3' 'Depends: xx
+Recommends: b'
+insertpackage 'unstable' 'xx' 'all' '3' 'Depends: a | b
+Recommends: b'
+
+setupaptarchive
+
+msgmsg "Test that the Recommends does not influence the Depends"
+testsuccessequal "The following additional packages will be installed:
+ a b
+The following NEW packages will be installed:
+ a b xx
+0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
+Inst a (2 unstable [all])
+Inst b (2 unstable [all])
+Inst xx (3 unstable [all])
+Conf a (2 unstable [all])
+Conf b (2 unstable [all])
+Conf xx (3 unstable [all])" apt install -s xx -qq
+
+
+msgmsg "Test that the Recommends in x does not influence the Depends in xx (one level lower)"
+testsuccessequal "The following additional packages will be installed:
+ a b xx
+The following NEW packages will be installed:
+ a b x xx
+0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
+Inst a (2 unstable [all])
+Inst b (2 unstable [all])
+Inst xx (3 unstable [all])
+Inst x (3 unstable [all])
+Conf a (2 unstable [all])
+Conf b (2 unstable [all])
+Conf xx (3 unstable [all])
+Conf x (3 unstable [all])" apt install -s x -qq