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

pym/portage.py

index 56f5ff529e965a12b7d0e5f8511e0ef2f1ee00e8..fa9f37535a551a131903427f49a9bac38c15e44a 100644 (file)
@@ -2564,13 +2564,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 \