summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt/cache.py6
-rw-r--r--debian/changelog1
2 files changed, 4 insertions, 3 deletions
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)
diff --git a/debian/changelog b/debian/changelog
index 7326ed09..7c7df72a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,7 @@ python-apt (0.7.94.3) UNRELEASED; urgency=low
- Make Cache.get_changes() much (~35x) faster (Closes: #578074).
- Make Cache.req_reinstall_pkgs much faster as well.
- Make Cache.get_providing_packages() about 1000 times faster.
+ - Use has_versions and has_provides from apt_pkg.Package where possible.
* apt/package.py:
- Decode using utf-8 in installed_files (LP: #407953).
- Fix fetch_source() to work when source name = binary name (LP: #552400).