From: Zac Medico Date: Wed, 28 Jun 2006 18:11:48 +0000 (-0000) Subject: Allow a config instance to be passed into cpv_expand so that it doesn't have to rely... X-Git-Tag: v2.1.1~356 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4b29012d31e05d746763c9c103fbb00cda0f5c04;p=portage.git 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 --- 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: