]> git.saurik.com Git - apt.git/commitdiff
ensure all removes are reported to hook scripts
authorDavid Kalnischkies <david@kalnischkies.de>
Sun, 24 Jul 2016 17:00:08 +0000 (19:00 +0200)
committerDavid Kalnischkies <david@kalnischkies.de>
Wed, 10 Aug 2016 21:18:04 +0000 (23:18 +0200)
Same reason and implementation as for configure.

apt-pkg/deb/dpkgpm.cc

index 9d48401dc27b2344a9614447b88302cce8b8c5c3..025dfbfd3dde8cb6b81540a516c72fe4a6aeca7d 100644 (file)
@@ -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;