diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-05-09 13:36:22 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-05-11 22:09:46 -0700 |
commit | 6634fce99179845d4c1efc7c7ed2f1a248bfa9c0 (patch) | |
tree | 8e658a8430bb9f82f912184e1879f627e98edcdc | |
parent | 2d2e8c0a94a5fae3d387520e6db2cee4e1973e4f (diff) | |
download | portage-6634fce99179845d4c1efc7c7ed2f1a248bfa9c0.tar.gz portage-6634fce99179845d4c1efc7c7ed2f1a248bfa9c0.tar.bz2 portage-6634fce99179845d4c1efc7c7ed2f1a248bfa9c0.zip |
cpv_expand: avoid old-style virtuals more
-rw-r--r-- | pym/portage/dbapi/cpv_expand.py | 9 |
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) |