diff options
| author | Julian Andres Klode <julian.klode@canonical.com> | 2021-04-23 17:06:40 +0200 |
|---|---|---|
| committer | Julian Andres Klode <julian.klode@canonical.com> | 2021-04-23 17:13:55 +0200 |
| commit | a7f2152f0ce46322791f0574d76aadfdfbde6bec (patch) | |
| tree | 95cc44a4c76c9ece42bb6ad01d9cfc05cf37406c /apt-pkg | |
| parent | 329f0cc3654f8d13bbaff71cc400cb9c4154ad53 (diff) | |
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.
Diffstat (limited to 'apt-pkg')
| -rw-r--r-- | apt-pkg/packagemanager.cc | 8 |
1 files changed, 4 insertions, 4 deletions
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. |
