summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-12-28 16:00:16 +0000
committerZac Medico <zmedico@gentoo.org>2007-12-28 16:00:16 +0000
commit11bd215c8cc81d07cceaf20a2a7fd167278b71e1 (patch)
treee8fe3733cd325751441494c43c20c1b9c4d71158 /pym
parentcc7c923d5c199433a3f9d6c1d653f009bb204fbb (diff)
downloadportage-11bd215c8cc81d07cceaf20a2a7fd167278b71e1.tar.gz
portage-11bd215c8cc81d07cceaf20a2a7fd167278b71e1.tar.bz2
portage-11bd215c8cc81d07cceaf20a2a7fd167278b71e1.zip
In getconfig(), pass the infile attribute into the shlex
constructor so that shlex.sourcehook() properly joins relative paths. (trunk r9054) svn path=/main/branches/2.1.2/; revision=9071
Diffstat (limited to 'pym')
-rw-r--r--pym/portage_util.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pym/portage_util.py b/pym/portage_util.py
index b615108c3..db93a042a 100644
--- a/pym/portage_util.py
+++ b/pym/portage_util.py
@@ -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: