diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-05-09 22:59:35 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-05-09 22:59:35 +0000 |
commit | 465c0fe68b19f84547b328669e9fd42039f0057e (patch) | |
tree | 61a68ea176b8ed8a2e895de9e16eae2246c4c8e7 | |
parent | 6c4112a19319fbf87250a6e3601875949812e1db (diff) | |
download | portage-465c0fe68b19f84547b328669e9fd42039f0057e.tar.gz portage-465c0fe68b19f84547b328669e9fd42039f0057e.tar.bz2 portage-465c0fe68b19f84547b328669e9fd42039f0057e.zip |
For bug #177591, increase shell compatibility by preserving quotes in varexpand() since quote removal is handled by shlex. (trunk r6504:6505)
svn path=/main/branches/2.1.2/; revision=6510
-rw-r--r-- | pym/portage_util.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pym/portage_util.py b/pym/portage_util.py index cc5a566b8..ec359e206 100644 --- a/pym/portage_util.py +++ b/pym/portage_util.py @@ -351,13 +351,13 @@ def getconfig(mycfg, tolerant=0, allow_sourcing=False, expand=True): #cache expansions of constant strings cexpand={} -def varexpand(mystring,mydict={}): +def varexpand(mystring, mydict={}): newstring = cexpand.get(" "+mystring, None) if newstring is not None: return newstring """ - new variable expansion code. Removes quotes, handles \n, etc. + new variable expansion code. Preserves quotes, handles \n, etc. This code is used by the configfile code, as well as others (parser) This would be a good bunch of code to port to C. """ @@ -373,6 +373,7 @@ def varexpand(mystring,mydict={}): if (indoub): newstring=newstring+"'" else: + newstring += "'" # Quote removal is handled by shlex. insing=not insing pos=pos+1 continue @@ -380,6 +381,7 @@ def varexpand(mystring,mydict={}): if (insing): newstring=newstring+'"' else: + newstring += '"' # Quote removal is handled by shlex. indoub=not indoub pos=pos+1 continue |