summaryrefslogtreecommitdiffstats
path: root/pym/_emerge
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-04-22 11:57:25 -0700
committerZac Medico <zmedico@gentoo.org>2012-04-22 11:57:25 -0700
commitd30db49bcaecbdeb20f6d4e180979b60b6260f69 (patch)
treea8c460d319896a5bf4e784ce21d4b8e827e80e44 /pym/_emerge
parentb93b24f9fa1b2761aa0768274bd93ade9b526961 (diff)
downloadportage-d30db49bcaecbdeb20f6d4e180979b60b6260f69.tar.gz
portage-d30db49bcaecbdeb20f6d4e180979b60b6260f69.tar.bz2
portage-d30db49bcaecbdeb20f6d4e180979b60b6260f69.zip
dbapi.cp_list: remove special case for virtuals
Since commit d603f1440c814377fbc1965729fd9b6b008cf76d, the match caches use the result from dep_expand for the cache_key, so the caches are free of old-style virtual mappings. This allows the match caches to be safely shared with cp_list.
Diffstat (limited to 'pym/_emerge')
-rw-r--r--pym/_emerge/PackageVirtualDbapi.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/pym/_emerge/PackageVirtualDbapi.py b/pym/_emerge/PackageVirtualDbapi.py
index a34d21c83..0f7be44b1 100644
--- a/pym/_emerge/PackageVirtualDbapi.py
+++ b/pym/_emerge/PackageVirtualDbapi.py
@@ -90,10 +90,11 @@ class PackageVirtualDbapi(dbapi):
return cpv in self._cpv_map
def cp_list(self, mycp, use_cache=1):
+ # NOTE: Cache can be safely shared with the match cache, since the
+ # match cache uses the result from dep_expand for the cache_key.
cache_key = (mycp, mycp)
cachelist = self._match_cache.get(cache_key)
- # cp_list() doesn't expand old-style virtuals
- if cachelist and cachelist[0].startswith(mycp):
+ if cachelist is not None:
return cachelist[:]
cpv_list = self._cp_map.get(mycp)
if cpv_list is None:
@@ -101,8 +102,7 @@ class PackageVirtualDbapi(dbapi):
else:
cpv_list = [pkg.cpv for pkg in cpv_list]
self._cpv_sort_ascending(cpv_list)
- if not (not cpv_list and mycp.startswith("virtual/")):
- self._match_cache[cache_key] = cpv_list
+ self._match_cache[cache_key] = cpv_list
return cpv_list[:]
def cp_all(self):