summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-06-28 18:11:48 +0000
committerZac Medico <zmedico@gentoo.org>2006-06-28 18:11:48 +0000
commit4b29012d31e05d746763c9c103fbb00cda0f5c04 (patch)
tree86ea0313aaf4fe737fe0142dffe9ab826bd82f73
parentded36bfae0aef2538187037df5af6bfb34baec89 (diff)
downloadportage-4b29012d31e05d746763c9c103fbb00cda0f5c04.tar.gz
portage-4b29012d31e05d746763c9c103fbb00cda0f5c04.tar.bz2
portage-4b29012d31e05d746763c9c103fbb00cda0f5c04.zip
Allow a config instance to be passed into cpv_expand so that it doesn't have to rely on global settings.
svn path=/main/trunk/; revision=3684
-rw-r--r--pym/portage.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 9e51c1b1f..29709b47f 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -3562,14 +3562,15 @@ def key_expand(mykey, mydb=None, use_cache=1, settings=None):
return virts[mykey][0]
return mykey
-def cpv_expand(mycpv,mydb=None,use_cache=1):
+def cpv_expand(mycpv, mydb=None, use_cache=1, settings=None):
"""Given a string (packagename or virtual) expand it into a valid
cat/package string. Virtuals use the mydb to determine which provided
virtual is a valid choice and defaults to the first element when there
are no installed/available candidates."""
myslash=mycpv.split("/")
mysplit=pkgsplit(myslash[-1])
- global settings
+ if settings is None:
+ settings = globals()["settings"]
virts = settings.getvirtuals("/")
virts_p = settings.get_virts_p("/")
if len(myslash)>2: