summaryrefslogtreecommitdiff
path: root/apt/cache.py
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2008-02-18 16:51:47 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2008-02-18 16:51:47 +0100
commit1bf52388c98e72768b8f883726ee7e2e2992e4ff (patch)
treeccffceb503eaa2d926cc75171dd3723a4a1de462 /apt/cache.py
parent706ef80cbb054b1750358f8a3866cd9d6f9e6929 (diff)
downloadpython-apt-1bf52388c98e72768b8f883726ee7e2e2992e4ff.tar.gz
* 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
Diffstat (limited to 'apt/cache.py')
-rw-r--r--apt/cache.py11
1 files changed, 11 insertions, 0 deletions
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()