Use varexpand to expand FETCHCOMMAND and RESUMECOMMAND.
authorZac Medico <zmedico@gentoo.org>
Sun, 6 May 2007 07:56:22 +0000 (07:56 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 6 May 2007 07:56:22 +0000 (07:56 -0000)
svn path=/main/trunk/; revision=6487

pym/portage/__init__.py

index 5143d7f6536d3ec34f2de9e2c699289adf4e32c3..89c0fee58c3a93a0e70569efcc65750bc610bca7 100644 (file)
@@ -2631,13 +2631,14 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
                                        writemsg_stdout(">>> Downloading '%s'\n" % \
                                                re.sub(r'//(.+):.+@(.+)/',r'//\1:*password*@\2/', loc))
                                        myfetch = locfetch.split()
-                                       variables = {"${DISTDIR}":mysettings["DISTDIR"],
-                                               "${URI}":loc, "${FILE}":myfile}
+                                       variables = {
+                                               "DISTDIR": mysettings["DISTDIR"],
+                                               "URI":     loc,
+                                               "FILE":    myfile
+                                       }
+                                       
                                        for i in xrange(len(myfetch)):
-                                               token = myfetch[i].strip("\"'")
-                                               for var, value in variables.iteritems():
-                                                       token = token.replace(var, value)
-                                               myfetch[i] = token
+                                               myfetch[i] = varexpand(myfetch[i], mydict=variables)
 
                                        spawn_keywords = {}
                                        if "userfetch" in mysettings.features and \