summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-05-06 19:37:37 +0000
committerZac Medico <zmedico@gentoo.org>2007-05-06 19:37:37 +0000
commit831012141601a654e1450ea2f9a5f5d9d6610d1a (patch)
tree26e02ffa10ae87e608ff3ab2ef0560dcbe07b20e /pym
parent11409be482effecdf57673318a47c045bb1c822b (diff)
downloadportage-831012141601a654e1450ea2f9a5f5d9d6610d1a.tar.gz
portage-831012141601a654e1450ea2f9a5f5d9d6610d1a.tar.bz2
portage-831012141601a654e1450ea2f9a5f5d9d6610d1a.zip
Use shlex for better splitting of FETCHCOMMAND.
svn path=/main/trunk/; revision=6490
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/__init__.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 89c0fee58..4cdfebe6f 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -2630,15 +2630,15 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
locfetch=fetchcommand
writemsg_stdout(">>> Downloading '%s'\n" % \
re.sub(r'//(.+):.+@(.+)/',r'//\1:*password*@\2/', loc))
- myfetch = locfetch.split()
variables = {
"DISTDIR": mysettings["DISTDIR"],
"URI": loc,
"FILE": myfile
}
-
- for i in xrange(len(myfetch)):
- myfetch[i] = varexpand(myfetch[i], mydict=variables)
+ import shlex, StringIO
+ lexer = shlex.shlex(StringIO.StringIO(locfetch), posix=True)
+ lexer.whitespace_split = True
+ myfetch = [varexpand(x, mydict=variables) for x in lexer]
spawn_keywords = {}
if "userfetch" in mysettings.features and \