In getconfig(), pass the infile attribute into the shlex
authorZac Medico <zmedico@gentoo.org>
Tue, 25 Dec 2007 05:41:06 +0000 (05:41 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 25 Dec 2007 05:41:06 +0000 (05:41 -0000)
constructor so that shlex.sourcehook() properly joins
relative paths.

svn path=/main/trunk/; revision=9054

pym/portage/util.py

index fa816d728ea1707402b3ddb59b9e7747fc8336e0..83d3fb430f7777201ee7009d70faf0f24010b123 100644 (file)
@@ -314,7 +314,10 @@ def getconfig(mycfg, tolerant=0, allow_sourcing=False, expand=True):
                        raise
                return None
        try:
-               lex = shlex.shlex(f, posix=True)
+               # The default shlex.sourcehook() implementation
+               # only joins relative paths when the infile
+               # attribute is properly set.
+               lex = shlex.shlex(f, infile=mycfg, posix=True)
                lex.wordchars=string.digits+string.letters+"~!@#$%*_\:;?,./-+{}"     
                lex.quotes="\"'"
                if allow_sourcing: