summaryrefslogtreecommitdiff
path: root/apt
diff options
context:
space:
mode:
authorSebastian Heinlein <sebi@glatzor.de>2008-08-21 18:42:02 +0200
committerSebastian Heinlein <sebi@glatzor.de>2008-08-21 18:42:02 +0200
commit1fd97df89aabf0034a13c65251cbb1edc04867b5 (patch)
tree2983ece5a6374765a80e61e0043faf4fb530e97f /apt
parentee9a44068f1af026b2ce3f70f65c2090594eb2a3 (diff)
downloadpython-apt-1fd97df89aabf0034a13c65251cbb1edc04867b5.tar.gz
Adapt dpkg to use the Cache class of python-apt
Diffstat (limited to 'apt')
-rw-r--r--apt/dpkg.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/apt/dpkg.py b/apt/dpkg.py
index 1b433bf2..7f4341f3 100644
--- a/apt/dpkg.py
+++ b/apt/dpkg.py
@@ -28,7 +28,7 @@ import apt
import sys
import os
from gettext import gettext as _
-from Cache import Cache
+from cache import Cache
class DebPackage(object):
debug = 0
@@ -62,9 +62,9 @@ class DebPackage(object):
# check for virtual pkgs
if not self._cache.has_key(depname):
- if self._cache.isVirtualPkg(depname):
+ if self._cache.isVirtualPackage(depname):
self._dbg(3,"_isOrGroupSatisfied(): %s is virtual dep" % depname)
- for pkg in self._cache.getProvidersForVirtual(depname):
+ for pkg in self._cache.getProvidingPackages(depname):
if pkg.isInstalled:
return True
continue
@@ -89,9 +89,9 @@ class DebPackage(object):
# if we don't have it in the cache, it may be virtual
if not self._cache.has_key(depname):
- if not self._cache.isVirtualPkg(depname):
+ if not self._cache.isVirtualPackage(depname):
continue
- providers = self._cache.getProvidersForVirtual(depname)
+ providers = self._cache.getProvidingPackages(depname)
# if a package just has a single virtual provider, we
# just pick that (just like apt)
if len(providers) != 1:
@@ -159,8 +159,8 @@ class DebPackage(object):
if not self._cache.has_key(depname):
# FIXME: we have to check for virtual replaces here as
# well (to pass tests/gdebi-test8.deb)
- if self._cache.isVirtualPkg(depname):
- for pkg in self._cache.getProvidersForVirtual(depname):
+ if self._cache.isVirtualPackage(depname):
+ for pkg in self._cache.getProvidingPackages(depname):
self._dbg(3, "conflicts virtual check: %s" % pkg.name)
# P/C/R on virtal pkg, e.g. ftpd
if self.pkgName == pkg.name:
@@ -454,8 +454,8 @@ if __name__ == "__main__":
cache = Cache()
vp = "www-browser"
- print "%s virtual: %s" % (vp,cache.isVirtualPkg(vp))
- providers = cache.getProvidersForVirtual(vp)
+ print "%s virtual: %s" % (vp,cache.isVirtualPackage(vp))
+ providers = cache.getProvidingPackages(vp)
print "Providers for %s :" % vp
for pkg in providers:
print " %s" % pkg.name