aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-05-09 13:36:22 -0700
committerZac Medico <zmedico@gentoo.org>2011-05-09 13:36:22 -0700
commitff65607c5dbd5f320dfbc4e77e97d7bfd69ab467 (patch)
tree7d4b15fd68f65fc7dd2611020598e39b2d8e2b95 /pym/portage
parentdep_check: avoid old-style virtuals code (diff)
downloadportage-ff65607c5dbd5f320dfbc4e77e97d7bfd69ab467.tar.gz
portage-ff65607c5dbd5f320dfbc4e77e97d7bfd69ab467.tar.bz2
portage-ff65607c5dbd5f320dfbc4e77e97d7bfd69ab467.zip
cpv_expand: avoid old-style virtuals more
Diffstat (limited to 'pym/portage')
-rw-r--r--pym/portage/dbapi/cpv_expand.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/pym/portage/dbapi/cpv_expand.py b/pym/portage/dbapi/cpv_expand.py
index b77c283f7..7077b1feb 100644
--- a/pym/portage/dbapi/cpv_expand.py
+++ b/pym/portage/dbapi/cpv_expand.py
@@ -26,7 +26,14 @@ def cpv_expand(mycpv, mydb=None, use_cache=1, settings=None):
mykey=myslash[0]+"/"+mysplit[0]
else:
mykey=mycpv
- if hasattr(mydb, "cp_list") and \
+
+ # Since Gentoo stopped using old-style virtuals in
+ # 2011, typically it's possible to avoid getvirtuals()
+ # calls entirely. Therefore, only call getvirtuals()
+ # if the atom category is "virtual" and cp_list()
+ # returns nothing.
+ if mykey.startswith("virtual/") and \
+ hasattr(mydb, "cp_list") and \
not mydb.cp_list(mykey, use_cache=use_cache):
if hasattr(mydb, "vartree"):
settings._populate_treeVirtuals_if_needed(mydb.vartree)