diff options
author | Zac Medico <zmedico@gentoo.org> | 2012-04-22 11:57:25 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2012-04-22 11:57:25 -0700 |
commit | d30db49bcaecbdeb20f6d4e180979b60b6260f69 (patch) | |
tree | a8c460d319896a5bf4e784ce21d4b8e827e80e44 /pym/portage/dbapi/porttree.py | |
parent | b93b24f9fa1b2761aa0768274bd93ade9b526961 (diff) | |
download | portage-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/portage/dbapi/porttree.py')
-rw-r--r-- | pym/portage/dbapi/porttree.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index f9d78dcdb..b060dd6a5 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -715,7 +715,8 @@ class portdbapi(dbapi): return l def cp_list(self, mycp, use_cache=1, mytree=None): - + # NOTE: Cache can be safely shared with the match cache, since the + # match cache uses the result from dep_expand for the cache_key. if self.frozen and mytree is not None \ and len(self.porttrees) == 1 \ and mytree == self.porttrees[0]: @@ -728,10 +729,8 @@ class portdbapi(dbapi): if cachelist is not None: # Try to propagate this to the match-all cache here for # repoman since he uses separate match-all caches for each - # profile (due to old-style virtuals). Do not propagate - # old-style virtuals since cp_list() doesn't expand them. - if not (not cachelist and mycp.startswith("virtual/")): - self.xcache["match-all"][(mycp, mycp)] = cachelist + # profile (due to old-style virtuals). + self.xcache["match-all"][(mycp, mycp)] = cachelist return cachelist[:] mysplit = mycp.split("/") invalid_category = mysplit[0] not in self._categories @@ -783,10 +782,7 @@ class portdbapi(dbapi): if self.frozen and mytree is None: cachelist = mylist[:] self.xcache["cp-list"][mycp] = cachelist - # Do not propagate old-style virtuals since - # cp_list() doesn't expand them. - if not (not cachelist and mycp.startswith("virtual/")): - self.xcache["match-all"][(mycp, mycp)] = cachelist + self.xcache["match-all"][(mycp, mycp)] = cachelist return mylist def freeze(self): |