summaryrefslogtreecommitdiffstats
path: root/pym/portage/dbapi/cpv_expand.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-05-08 23:23:07 -0700
committerZac Medico <zmedico@gentoo.org>2011-05-08 23:23:07 -0700
commit16f3856ff76aca1ee668a464aefa4102b3cccb22 (patch)
tree725f6bb615280eb1ddb4dc8c238becd88d602c96 /pym/portage/dbapi/cpv_expand.py
parent1a693adbc6ea559e92f88268c0d5b3d54c0f7c06 (diff)
downloadportage-16f3856ff76aca1ee668a464aefa4102b3cccb22.tar.gz
portage-16f3856ff76aca1ee668a464aefa4102b3cccb22.tar.bz2
portage-16f3856ff76aca1ee668a464aefa4102b3cccb22.zip
cpv_expand: populate old-style virts on demand
If old-style virtuals code is triggered here and we are given a vartree, use it to avoid creating a temporary instance.
Diffstat (limited to 'pym/portage/dbapi/cpv_expand.py')
-rw-r--r--pym/portage/dbapi/cpv_expand.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/pym/portage/dbapi/cpv_expand.py b/pym/portage/dbapi/cpv_expand.py
index 26f994887..b77c283f7 100644
--- a/pym/portage/dbapi/cpv_expand.py
+++ b/pym/portage/dbapi/cpv_expand.py
@@ -28,6 +28,8 @@ def cpv_expand(mycpv, mydb=None, use_cache=1, settings=None):
mykey=mycpv
if 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)
virts = settings.getvirtuals().get(mykey)
if virts:
mykey_orig = mykey
@@ -76,6 +78,8 @@ def cpv_expand(mycpv, mydb=None, use_cache=1, settings=None):
mykey=matches[0]
if not mykey and not isinstance(mydb, list):
+ if hasattr(mydb, "vartree"):
+ settings._populate_treeVirtuals_if_needed(mydb.vartree)
virts_p = settings.get_virts_p().get(myp)
if virts_p:
mykey = virts_p[0]