summaryrefslogtreecommitdiff
path: root/apt-pkg/solver3.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2025-03-20 14:51:10 +0000
committerJulian Andres Klode <jak@debian.org>2025-03-20 14:51:10 +0000
commitfff3dddedba0d19d722cb4889bab355182cc2522 (patch)
tree08029e37929cce1abb919628308c1ec88564a44e /apt-pkg/solver3.cc
parent7ef14b64596bd0ca78feaea5fda22b8d524de286 (diff)
parent61b3b1840568b223baad08da1eb9a1fb5d6e7f91 (diff)
Merge branch 'solver3' into 'main'
Various solver bug fixes See merge request apt-team/apt!466
Diffstat (limited to 'apt-pkg/solver3.cc')
-rw-r--r--apt-pkg/solver3.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/apt-pkg/solver3.cc b/apt-pkg/solver3.cc
index 4030b9de1..4d988b523 100644
--- a/apt-pkg/solver3.cc
+++ b/apt-pkg/solver3.cc
@@ -1099,6 +1099,11 @@ bool APT::Solver::FromDepCache(pkgDepCache &depcache)
}
}
+ // Clause discovery depends on the manual flag, so we need to set the manual flag first before we discover any packages
+ for (auto P = cache.PkgBegin(); not P.end(); P++)
+ if (P->CurrentVer && not(depcache[P].Flags & pkgCache::Flag::Auto) && (depcache[P].Keep() || depcache[P].Install()))
+ (*this)[P].flags.manual = true;
+
for (auto P = cache.PkgBegin(); not P.end(); P++)
{
if (P->VersionList == nullptr)
@@ -1142,8 +1147,6 @@ bool APT::Solver::FromDepCache(pkgDepCache &depcache)
if (unlikely(debug >= 1))
std::cerr << "Install " << P.FullName() << " (" << (isEssential ? "E" : "") << (isAuto ? "M" : "") << (Root ? "R" : "") << ")"
<< "\n";
-
- (*this)[P].flags.manual = not isAuto;
if (not isOptional)
{
// Pre-empt the non-optional requests, as we don't want to queue them, we can just "unit propagate" here.