In getconfig(), pass the infile attribute into the shlex
authorZac Medico <zmedico@gentoo.org>
Fri, 28 Dec 2007 16:00:16 +0000 (16:00 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 28 Dec 2007 16:00:16 +0000 (16:00 -0000)
constructor so that shlex.sourcehook() properly joins
relative paths. (trunk r9054)

svn path=/main/branches/2.1.2/; revision=9071

pym/portage_util.py

index b615108c3983f29289ba807cbab0581f97386727..db93a042a37967f3dbdae53fabb318e6e3718bc8 100644 (file)
@@ -300,7 +300,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: