From: Zac Medico Date: Mon, 9 May 2011 20:36:22 +0000 (-0700) Subject: cpv_expand: avoid old-style virtuals more X-Git-Tag: v2.1.9.49~19 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6634fce99179845d4c1efc7c7ed2f1a248bfa9c0;p=portage.git cpv_expand: avoid old-style virtuals more --- 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)