projects
/
portage.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7d52a8c
)
Optimize varexpand for bug #149900.
author
Zac Medico
<zmedico@gentoo.org>
Mon, 2 Oct 2006 22:39:03 +0000
(22:39 -0000)
committer
Zac Medico
<zmedico@gentoo.org>
Mon, 2 Oct 2006 22:39:03 +0000
(22:39 -0000)
svn path=/main/trunk/; revision=4574
pym/portage_util.py
patch
|
blob
|
history
diff --git
a/pym/portage_util.py
b/pym/portage_util.py
index 83cdeda50a0fdcf55acd4653ae5c7169ae66a545..9d1bb84c21acda01dbeab8cf75c79544dd3dd795 100644
(file)
--- a/
pym/portage_util.py
+++ b/
pym/portage_util.py
@@
-286,10
+286,10
@@
def getconfig(mycfg,tolerant=0,allow_sourcing=False):
#cache expansions of constant strings
cexpand={}
def varexpand(mystring,mydict={}):
- try:
- return cexpand[" "+mystring]
- except KeyError:
- pass
+ newstring = cexpand.get(" "+mystring, None)
+ if newstring is not None:
+ return newstring
+
"""
new variable expansion code. Removes quotes, handles \n, etc.
This code is used by the configfile code, as well as others (parser)