summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/deb/dpkgpm.cc5
-rw-r--r--apt-pkg/packagemanager.h16
2 files changed, 19 insertions, 2 deletions
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index a640a0c77..8318fe37f 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -468,6 +468,9 @@ void pkgDPkgPM::ProcessDpkgStatusLine(int OutStatusFd, char *line)
write(OutStatusFd, status.str().c_str(), status.str().size());
if (Debug == true)
std::clog << "send: '" << status.str() << "'" << endl;
+
+ if (strncmp(action, "disappear", strlen("disappear")) == 0)
+ disappearedPkgs.insert(string(pkg_or_trigger));
return;
}
@@ -913,6 +916,8 @@ bool pkgDPkgPM::Go(int OutStatusFd)
{
if((*I).Pkg.end() == true)
continue;
+ if (I->Op == Item::Configure && disappearedPkgs.find(I->Pkg.Name()) != disappearedPkgs.end())
+ continue;
Args[n++] = I->Pkg.Name();
Size += strlen(Args[n-1]);
}
diff --git a/apt-pkg/packagemanager.h b/apt-pkg/packagemanager.h
index af1476b7a..efd2cfac6 100644
--- a/apt-pkg/packagemanager.h
+++ b/apt-pkg/packagemanager.h
@@ -28,6 +28,7 @@
#include <iostream>
#include <apt-pkg/pkgcache.h>
#include <apt-pkg/depcache.h>
+#include <set>
using std::string;
@@ -47,7 +48,15 @@ class pkgPackageManager : protected pkgCache::Namespace
pkgDepCache &Cache;
pkgOrderList *List;
bool Debug;
-
+
+ /** \brief saves packages dpkg let disappear
+
+ This way APT can retreat from trying to configure these
+ packages later on and a frontend can choose to display a
+ notice to inform the user about these disappears.
+ */
+ std::set<std::string> disappearedPkgs;
+
bool DepAdd(pkgOrderList &Order,PkgIterator P,int Depth = 0);
void ImmediateAdd(PkgIterator P, bool UseInstallVer, unsigned const int &Depth = 0);
virtual OrderResult OrderInstall();
@@ -93,7 +102,10 @@ class pkgPackageManager : protected pkgCache::Namespace
// stuff that needs to be done after the fork
OrderResult DoInstallPostFork(int statusFd=-1);
bool FixMissing();
-
+
+ /** \brief returns all packages dpkg let disappear */
+ inline std::set<std::string> GetDisappearedPackages() { return disappearedPkgs; };
+
pkgPackageManager(pkgDepCache *Cache);
virtual ~pkgPackageManager();
};