diff options
Diffstat (limited to 'apt-pkg')
| -rw-r--r-- | apt-pkg/depcache.cc | 4 | ||||
| -rw-r--r-- | apt-pkg/solver3.cc | 6 | ||||
| -rw-r--r-- | apt-pkg/solver3.h | 4 |
3 files changed, 12 insertions, 2 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index f7f508f85..09d7a93bc 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -1853,6 +1853,10 @@ bool pkgDepCache::IsInstallOkMultiArchSameVersionSynced(PkgIterator const &Pkg, if (CV.Downloadable() == false) continue; + // Ignore siblings marked for deletion + if (PkgState[P->ID].Delete()) + continue; + PkgState[Pkg->ID].iFlags |= AutoKept; if (unlikely(DebugMarker == true)) std::clog << OutputInDepth(Depth) << "Ignore MarkInstall of " << APT::PrettyPkg(this, Pkg) diff --git a/apt-pkg/solver3.cc b/apt-pkg/solver3.cc index 65e3940b4..4d7e0ff0b 100644 --- a/apt-pkg/solver3.cc +++ b/apt-pkg/solver3.cc @@ -1007,6 +1007,7 @@ void APT::Solver::UndoOne() auto &state = (*this)[solvedItem.assigned]; state.decision = Decision::NONE; state.reason = nullptr; + state.reasonStr = nullptr; state.depth = 0; } @@ -1071,6 +1072,8 @@ bool APT::Solver::Pop() if (not choice.empty() && not Enqueue(choice, false, {})) return false; + (*this)[choice].reasonStr = "backtracked"; + if (unlikely(debug >= 2)) std::cerr << "Backtracked to choice " << choice.toString(cache) << "\n"; @@ -1366,7 +1369,8 @@ bool APT::Solver::ToDepCache(pkgDepCache &depcache) const } else if (P->CurrentVer || depcache[P].Install()) { - depcache.MarkDelete(P, false, 0, not(*this)[P].reason); + bool automatic = (not (*this)[P].reason) && (not (*this)[P].reasonStr); + depcache.MarkDelete(P, false, 0, automatic); depcache[P].Marked = 0; depcache[P].Garbage = 1; } diff --git a/apt-pkg/solver3.h b/apt-pkg/solver3.h index 8d834b313..45b55d962 100644 --- a/apt-pkg/solver3.h +++ b/apt-pkg/solver3.h @@ -237,7 +237,7 @@ class Solver // \brief If set, removals are allowed. bool AllowRemove{_config->FindB("APT::Solver::Remove", not(requestFlags & EDSP::Request::FORBID_REMOVE))}; // \brief If set, removal of manual packages is allowed. - bool AllowRemoveManual{AllowRemove && _config->FindB("APT::Solver::RemoveManual", false)}; + bool AllowRemoveManual{AllowRemove && _config->FindB("APT::Solver::RemoveManual", true)}; // \brief If set, installs are allowed. bool AllowInstall{_config->FindB("APT::Solver::Install", not(requestFlags & EDSP::Request::FORBID_NEW_INSTALL))}; // \brief If set, we use strict pinning. @@ -477,6 +477,8 @@ struct APT::Solver::State // Vars < 0 are package ID, reasons > 0 are version IDs. const Clause *reason{}; + const char *reasonStr{}; + // \brief The depth at which the decision has been taken depth_type depth{0}; |
