summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-07-24 19:00:08 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2016-08-10 23:18:04 +0200
commitbfc0933abedcd57e0a5bd07e282f3a50ba1fa5b2 (patch)
tree6aa8e7e39cee0170c2846f301b00029beef049ad
parent9ffbac99e52c91182ed8ff8678a994626b194e69 (diff)
ensure all removes are reported to hook scripts
Same reason and implementation as for configure.
-rw-r--r--apt-pkg/deb/dpkgpm.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index 9d48401dc..025dfbfd3 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -1284,6 +1284,19 @@ bool pkgDPkgPM::Go(APT::Progress::PackageManager *progress)
std::find_if_not(List.crbegin(), List.crend(), [](Item const &i) { return i.Op == Item::Configure; }),
List.crend(), [](Item const &i) { return i.Op == Item::Remove || i.Op == Item::Purge; }).base());
+ // explicitely remove everything for hookscripts and progress building
+ {
+ std::unordered_set<decltype(pkgCache::Package::ID)> alreadyRemoved;
+ for (auto && I : List)
+ if (I.Op == Item::Remove || I.Op == Item::Purge)
+ alreadyRemoved.insert(I.Pkg->ID);
+ decltype(List) AppendList;
+ for (auto Pkg = Cache.PkgBegin(); Pkg.end() == false; ++Pkg)
+ if (Cache[Pkg].Delete() && alreadyRemoved.insert(Pkg->ID).second == true)
+ AppendList.emplace_back(Cache[Pkg].Purge() ? Item::Purge : Item::Remove, Pkg);
+ std::move(AppendList.begin(), AppendList.end(), std::back_inserter(List));
+ }
+
// explicitely configure everything for hookscripts and progress building
{
std::unordered_set<decltype(pkgCache::Package::ID)> alreadyConfigured;