From 1bf52388c98e72768b8f883726ee7e2e2992e4ff Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 18 Feb 2008 16:51:47 +0100 Subject: * python/apt_pkgmodule.cc: - add InstState{Ok,ReInstReq,Hold,HoldReInstReq} constants * apt/cache.py: - add reqReinstallPkgs property that lists all packages in ReInstReq or HoldReInstReq --- apt/cache.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'apt') diff --git a/apt/cache.py b/apt/cache.py index dc2f5522..a92bd5be 100644 --- a/apt/cache.py +++ b/apt/cache.py @@ -122,6 +122,17 @@ class Cache(object): self._depcache.Upgrade(distUpgrade) self.cachePostChange() + @property + def reqReinstallPkgs(self): + " return the packages not downloadable packages in reqreinst state " + reqreinst = set() + for pkg in self: + if (not pkg.candidateDownloadable and + (pkg._pkg.InstState == apt_pkg.InstStateReInstReq or + pkg._pkg.InstState == apt_pkg.InstStateHoldReInstReq)): + reqreinst.add(pkg.name) + return reqreinst + def _runFetcher(self, fetcher): # do the actual fetching res = fetcher.Run() -- cgit v1.2.3