summaryrefslogtreecommitdiff
path: root/apt/cache.py
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2008-11-24 14:46:48 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2008-11-24 14:46:48 +0100
commit59937b2d3b6319773ab174066222c81ecd176628 (patch)
tree10863dc97ff1d44e9b4732896d03eb0f3257004f /apt/cache.py
parentb90575e96622f14dc3d25972d0498faf0a02259e (diff)
parentd7b8902c36f77b7ae87b88cb4fdfbba7aa2ff833 (diff)
downloadpython-apt-59937b2d3b6319773ab174066222c81ecd176628.tar.gz
merged from the consolidation-bracn (with some modificatins)
Diffstat (limited to 'apt/cache.py')
-rw-r--r--apt/cache.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/apt/cache.py b/apt/cache.py
index bbf2165b..3c032052 100644
--- a/apt/cache.py
+++ b/apt/cache.py
@@ -182,6 +182,28 @@ class Cache(object):
finally:
os.close(lock)
+ def getProvidingPackages(self, virtual):
+ """
+ Return a list of packages which provide the virtual package of the
+ specified name
+ """
+ providers = []
+ try:
+ vp = self._cache[virtual]
+ if len(vp.VersionList) != 0:
+ return providers
+ except KeyError:
+ return providers
+ for pkg in self:
+ v = self._depcache.GetCandidateVer(pkg._pkg)
+ if v == None:
+ continue
+ for p in v.ProvidesList:
+ if virtual == p[0]:
+ # we found a pkg that provides this virtual pkg
+ providers.append(pkg)
+ return providers
+
def update(self, fetchProgress=None):
" run the equivalent of apt-get update "
lockfile = apt_pkg.Config.FindDir("Dir::State::Lists") + "lock"
@@ -232,6 +254,10 @@ class Cache(object):
fetcher.Shutdown()
return (res == pm.ResultCompleted)
+ def clear(self):
+ """ Unmark all changes """
+ self._depcache.Init()
+
# cache changes
def cachePostChange(self):
" called internally if the cache has changed, emit a signal then "