summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2025-03-20 20:47:28 +0100
committerJulian Andres Klode <julian.klode@canonical.com>2025-03-20 22:22:17 +0100
commit83bad834c63604035c251f24ee9ea99dac1a1369 (patch)
tree98042f25a38980645a2eb972ff79f8022c254e87 /apt-pkg
parentfff3dddedba0d19d722cb4889bab355182cc2522 (diff)
solver3: Handle previously satisfied Suggests last
In #2103556 we can see that avahi-daemon Suggests avahi-autoipd, which is previously satisfied by dhcpcd-base due to a Provides; that Provides has now been dropped; and solver3 keeps the update back. As in LP: #2102720 this is a Suggests and it seems wrong for the Suggests to actually influence dependency choices and be able to hold back updates. Instead, satisfy previously satisfied Suggests at the end. For the particular case in this bug report, this results in avahi-autoipd, the real package, to be installed to keep the Suggests working which needs further consideration whether that is the right choice (we can argue either way), but in any case this is a better solution. This in turn breaks the conkeror test which is a somewhat awkward unrealistic test these days as it has no automatically installed packages; because previously something must have had a Suggests on say libdatrie1 or something that was processed first. This would be fine before 5daf6dbfd272be2f8e3c59d4bab4be8c119b7aa1 but as of that commit we no longer rewrite conkeror Depends xulrunner-1.9 | xulrunner-1.9.1 into conkeror Depends xulrunner-1.9.1 | xulrunner-1.9 Because xulrunner-1.9 is manually installed. Mark xulrunner-1.9 as automatically installed to fix the test case. The resulting behavior seems correct: If you manually want xulrunner-1.9 specifically we should not replace it with xulrunner-1.9.1; but if it's automatically installed we should. LP: #2103556
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/solver3.cc1
-rw-r--r--apt-pkg/solver3.h5
2 files changed, 5 insertions, 1 deletions
diff --git a/apt-pkg/solver3.cc b/apt-pkg/solver3.cc
index 4d988b523..66e307133 100644
--- a/apt-pkg/solver3.cc
+++ b/apt-pkg/solver3.cc
@@ -861,6 +861,7 @@ APT::Solver::Clause APT::Solver::TranslateOrGroup(pkgCache::DepIterator start, p
{
if (unlikely(debug >= 3))
std::cerr << "Try to keep satisfied: " << clause.toString(cache, true) << std::endl;
+ clause.group = Group::SatisfySuggests;
}
else if (not important)
{
diff --git a/apt-pkg/solver3.h b/apt-pkg/solver3.h
index c2d6e035e..6810df426 100644
--- a/apt-pkg/solver3.h
+++ b/apt-pkg/solver3.h
@@ -122,7 +122,10 @@ class Solver
// allowing a simple implementation of an autoremoval code.
UpgradeAuto,
KeepAuto,
- ObsoleteAuto
+ ObsoleteAuto,
+
+ // Satisfy optional dependencies that were previously satisfied but won't otherwise be installed
+ SatisfySuggests,
};
// \brief Type to record depth at. This may very well be a 16-bit