From d624e84bf5ea40d2ae19b8ac02af77766e063d52 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 21 Apr 2010 16:00:35 +0200 Subject: apt/cache.py: Use has_versions and has_provides from apt_pkg.Package where possible. --- apt/cache.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'apt/cache.py') diff --git a/apt/cache.py b/apt/cache.py index 2008fbc0..8e07e4d0 100644 --- a/apt/cache.py +++ b/apt/cache.py @@ -136,7 +136,7 @@ class Cache(object): progress.update(i/float(size)*100) last = i # drop stuff with no versions (cruft) - if len(pkg.version_list) > 0: + if pkg.has_versions: self._set.add(pkg.name) i += 1 @@ -275,7 +275,7 @@ class Cache(object): except KeyError: return False else: - return bool(pkg.provides_list and not pkg.version_list) + return bool(pkg.has_provides and not pkg.has_versions) def get_providing_packages(self, virtual, candidate_only=True): """Return a list of all packages providing a virtual package. @@ -291,7 +291,7 @@ class Cache(object): get_candidate_ver = self._depcache.get_candidate_ver try: vp = self._cache[virtual] - if len(vp.version_list) != 0: + if vp.has_versions: return list(providers) except KeyError: return list(providers) -- cgit v1.2.3