From a7f2152f0ce46322791f0574d76aadfdfbde6bec Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 23 Apr 2021 17:06:40 +0200 Subject: Support deconfiguring Essential packages dpkg 1.20.8 also made --force-remove-essential optional for deconfiguring essential packages, so let's do this. Also extend the test case to make sure we actuall pass auto-deconfigure and do not make any --remove calls, or pass --force-remove to dpkg. --- apt-pkg/packagemanager.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc index 1a2850a2a..7d5733bbe 100644 --- a/apt-pkg/packagemanager.cc +++ b/apt-pkg/packagemanager.cc @@ -672,7 +672,10 @@ bool pkgPackageManager::EarlyRemove(PkgIterator Pkg, DepIterator const * const D } } - if (IsEssential == true) + // dpkg will auto-deconfigure it, no need for the big remove hammer + if (Dep != NULL && (*Dep)->Type == pkgCache::Dep::DpkgBreaks) + return true; + else if (IsEssential == true) { // FIXME: Unify messaging with Protected below. if (_config->FindB("APT::Force-LoopBreak",false) == false) @@ -682,9 +685,6 @@ bool pkgPackageManager::EarlyRemove(PkgIterator Pkg, DepIterator const * const D "but if you really want to do it, activate the " "APT::Force-LoopBreak option."),Pkg.FullName().c_str()); } - // dpkg will auto-deconfigure it, no need for the big remove hammer - else if (Dep != NULL && (*Dep)->Type == pkgCache::Dep::DpkgBreaks) - return true; else if (IsProtected == true) { // FIXME: Message should talk about Protected, not Essential, and unified. -- cgit v1.2.3-70-g09d2