diff options
| -rw-r--r-- | apt-pkg/solver3.cc | 14 | ||||
| -rw-r--r-- | test/integration/solver3.broken | 2 | ||||
| -rwxr-xr-x | test/integration/test-bug-675449-essential-are-protected | 15 |
3 files changed, 28 insertions, 3 deletions
diff --git a/apt-pkg/solver3.cc b/apt-pkg/solver3.cc index 44a5075da..f6ee1d243 100644 --- a/apt-pkg/solver3.cc +++ b/apt-pkg/solver3.cc @@ -950,6 +950,20 @@ bool APT::Solver::FromDepCache(pkgDepCache &depcache) Discover(Var(P)); } } + else if (IsUpgrade && AllowRemove && AllowInstall && (P->Flags & pkgCache::Flag::Essential)) + { + Clause w{Var(), Group::InstallManual, false}; + auto G = P.Group(); + for (auto P = G.PackageList(); not P.end(); P = G.NextPkg(P)) + if (P->Flags & pkgCache::Flag::Essential) + w.solutions.push_back(Var(P)); + std::stable_sort(w.solutions.begin(), w.solutions.end(), CompareProviders3{cache, policy, P, *this}); + if (unlikely(debug >= 1)) + std::cerr << "Install essential package " << P << std::endl; + RegisterClause(std::move(w)); + if (not AddWork(Work{rootState->clauses.back().get(), depth()})) + return false; + } } return Propagate(); diff --git a/test/integration/solver3.broken b/test/integration/solver3.broken index 540bfbca1..74507b25f 100644 --- a/test/integration/solver3.broken +++ b/test/integration/solver3.broken @@ -6,9 +6,7 @@ test-apt-move-and-forget-manual-sections test-bug-470115-new-and-tighten-recommends test-bug-602412-dequote-redirect test-bug-611729-mark-as-manual -test-bug-675449-essential-are-protected test-bug-745046-candidate-propagation-fails -test-bug-767891-force-essential-important test-bug-961266-hold-means-hold test-dont-forget-conflicts-via-unknown-architectures test-explore-or-groups-in-markinstall diff --git a/test/integration/test-bug-675449-essential-are-protected b/test/integration/test-bug-675449-essential-are-protected index e7460aeb7..36e7b645e 100755 --- a/test/integration/test-bug-675449-essential-are-protected +++ b/test/integration/test-bug-675449-essential-are-protected @@ -112,4 +112,17 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: foo : Depends: libfoo but it is not going to be installed -E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.' aptget purge libfoo -s +E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.' aptget purge libfoo -s --solver internal + +testequal 'Reading package lists... +Building dependency tree... +Solving dependencies... +Some packages could not be installed. This may mean that you have +requested an impossible situation or if you are using the unstable +distribution that some required packages have not yet been created +or been moved out of Incoming. +The following information may help to resolve the situation: + +The following packages have unmet dependencies: + foo : Depends: libfoo but it is not going to be installed +E: Conflict: foo:amd64 -> libfoo:amd64 but not libfoo:amd64' aptget purge libfoo -s --solver 3.0 |
