summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-12-25 05:41:06 +0000
committerZac Medico <zmedico@gentoo.org>2007-12-25 05:41:06 +0000
commit9f19bafd76cbbf0d1ace2b2243cd7434ed30cbbf (patch)
treeb47cebb814758d1e303b4ae8866719e9093b2d98
parent5d41edfecc6eb9d5b045877a5796c3d4b6528e56 (diff)
downloadportage-9f19bafd76cbbf0d1ace2b2243cd7434ed30cbbf.tar.gz
portage-9f19bafd76cbbf0d1ace2b2243cd7434ed30cbbf.tar.bz2
portage-9f19bafd76cbbf0d1ace2b2243cd7434ed30cbbf.zip
In getconfig(), pass the infile attribute into the shlex
constructor so that shlex.sourcehook() properly joins relative paths. svn path=/main/trunk/; revision=9054
-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 fa816d728..83d3fb430 100644
--- a/pym/portage/util.py
+++ b/pym/portage/util.py
@@ -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: