diff options
| author | Julian Andres Klode <julian.klode@canonical.com> | 2021-03-01 22:29:12 +0100 |
|---|---|---|
| committer | Julian Andres Klode <julian.klode@canonical.com> | 2021-03-01 22:29:12 +0100 |
| commit | 757304ce49f7b9335132be53e8162cce89e85033 (patch) | |
| tree | 59f317fb7fabbfff52fdd041c614f9156fdc74c7 /apt-pkg | |
| parent | db391379e175aa742e390aab24dcf224a8a97e88 (diff) | |
| parent | 16b905aabc9b8700b937dd1541d52ea0df2f3a0e (diff) | |
Merge tag '2.2.1'
apt Debian release 2.2.1
Diffstat (limited to 'apt-pkg')
| -rw-r--r-- | apt-pkg/contrib/configuration.cc | 1 | ||||
| -rw-r--r-- | apt-pkg/contrib/fileutl.cc | 4 | ||||
| -rw-r--r-- | apt-pkg/deb/dpkgpm.cc | 3 | ||||
| -rw-r--r-- | apt-pkg/packagemanager.cc | 25 |
4 files changed, 24 insertions, 9 deletions
diff --git a/apt-pkg/contrib/configuration.cc b/apt-pkg/contrib/configuration.cc index a8fced724..03bdb12a8 100644 --- a/apt-pkg/contrib/configuration.cc +++ b/apt-pkg/contrib/configuration.cc @@ -31,6 +31,7 @@ #include <string.h> #include <algorithm> +#include <array> #include <fstream> #include <iterator> #include <numeric> diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index 091def3d4..eb5dc859d 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -140,10 +140,6 @@ bool RunScripts(const char *Cnf) return _error->Errno("waitpid","Couldn't wait for subprocess"); } - // Restore sig int/quit - signal(SIGQUIT,SIG_DFL); - signal(SIGINT,SIG_DFL); - // Check for an error code. if (WIFEXITED(Status) == 0 || WEXITSTATUS(Status) != 0) { diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index c496538cc..a8f99a855 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -1824,6 +1824,9 @@ bool pkgDPkgPM::Go(APT::Progress::PackageManager *progress) case Item::Install: ADDARGC("--unpack"); ADDARGC("--auto-deconfigure"); + // dpkg < 1.20.8 needs --force-remove-protected to deconfigure protected packages + if (dpkgProtectedField) + ADDARGC("--force-remove-protected"); break; } diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc index 0c6998def..1a2850a2a 100644 --- a/apt-pkg/packagemanager.cc +++ b/apt-pkg/packagemanager.cc @@ -652,9 +652,11 @@ bool pkgPackageManager::EarlyRemove(PkgIterator Pkg, DepIterator const * const D // Essential packages get special treatment bool IsEssential = false; - if ((Pkg->Flags & pkgCache::Flag::Essential) != 0 || - (Pkg->Flags & pkgCache::Flag::Important) != 0) + if ((Pkg->Flags & pkgCache::Flag::Essential) != 0) IsEssential = true; + bool IsProtected = false; + if ((Pkg->Flags & pkgCache::Flag::Important) != 0) + IsProtected = true; /* Check for packages that are the dependents of essential packages and promote them too */ @@ -662,14 +664,17 @@ bool pkgPackageManager::EarlyRemove(PkgIterator Pkg, DepIterator const * const D { for (pkgCache::DepIterator D = Pkg.RevDependsList(); D.end() == false && IsEssential == false; ++D) - if (D->Type == pkgCache::Dep::Depends || D->Type == pkgCache::Dep::PreDepends) - if ((D.ParentPkg()->Flags & pkgCache::Flag::Essential) != 0 || - (D.ParentPkg()->Flags & pkgCache::Flag::Important) != 0) + if (D->Type == pkgCache::Dep::Depends || D->Type == pkgCache::Dep::PreDepends) { + if ((D.ParentPkg()->Flags & pkgCache::Flag::Essential) != 0) IsEssential = true; + if ((D.ParentPkg()->Flags & pkgCache::Flag::Important) != 0) + IsProtected = true; + } } if (IsEssential == true) { + // FIXME: Unify messaging with Protected below. if (_config->FindB("APT::Force-LoopBreak",false) == false) return _error->Error(_("This installation run will require temporarily " "removing the essential package %s due to a " @@ -680,6 +685,16 @@ bool pkgPackageManager::EarlyRemove(PkgIterator Pkg, DepIterator const * const D // 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. + if (_config->FindB("APT::Force-LoopBreak",false) == false) + return _error->Error(_("This installation run will require temporarily " + "removing the essential package %s due to a " + "Conflicts/Pre-Depends loop. This is often bad, " + "but if you really want to do it, activate the " + "APT::Force-LoopBreak option."),Pkg.FullName().c_str()); + } bool Res = SmartRemove(Pkg); if (Cache[Pkg].Delete() == false) |
