@@ -30,7 +30,7 @@ def get(url, path, verbose=False):
3030 download (sha_path , sha_url , verbose )
3131 download (temp_path , url , verbose )
3232 verify (temp_path , sha_path , verbose )
33- print ("moving " + temp_path + " to " + path )
33+ print ("moving {} to {}" . format ( temp_path , path ) )
3434 shutil .move (temp_path , path )
3535 finally :
3636 delete_if_present (sha_path )
@@ -44,7 +44,7 @@ def delete_if_present(path):
4444
4545
4646def download (path , url , verbose ):
47- print ("downloading " + url + " to " + path )
47+ print ("downloading {} to {}" . format ( url , path ) )
4848 # see http://serverfault.com/questions/301128/how-to-download
4949 if sys .platform == 'win32' :
5050 run (["PowerShell.exe" , "/nologo" , "-Command" ,
@@ -133,32 +133,32 @@ def download_stage0(self):
133133 if os .path .exists (self .bin_root ()):
134134 shutil .rmtree (self .bin_root ())
135135 channel = self .stage0_rustc_channel ()
136- filename = "rust-std-" + channel + "-" + self . build + ". tar.gz"
136+ filename = "rust-std-{}-{}. tar.gz" . format ( channel , self . build )
137137 url = "https://static.rust-lang.org/dist/" + self .stage0_rustc_date ()
138138 tarball = os .path .join (rustc_cache , filename )
139139 if not os .path .exists (tarball ):
140- get (url + "/" + filename , tarball , verbose = self .verbose )
140+ get ("{}/{}" . format ( url , filename ) , tarball , verbose = self .verbose )
141141 unpack (tarball , self .bin_root (),
142142 match = "rust-std-" + self .build ,
143143 verbose = self .verbose )
144144
145- filename = "rustc-" + channel + "-" + self . build + ". tar.gz"
145+ filename = "rustc-{}-{}. tar.gz" . format ( channel , self . build )
146146 url = "https://static.rust-lang.org/dist/" + self .stage0_rustc_date ()
147147 tarball = os .path .join (rustc_cache , filename )
148148 if not os .path .exists (tarball ):
149- get (url + "/" + filename , tarball , verbose = self .verbose )
149+ get ("{}/{}" . format ( url , filename ) , tarball , verbose = self .verbose )
150150 unpack (tarball , self .bin_root (), match = "rustc" , verbose = self .verbose )
151151 with open (self .rustc_stamp (), 'w' ) as f :
152152 f .write (self .stage0_rustc_date ())
153153
154154 if self .cargo ().startswith (self .bin_root ()) and \
155155 (not os .path .exists (self .cargo ()) or self .cargo_out_of_date ()):
156156 channel = self .stage0_cargo_channel ()
157- filename = "cargo-" + channel + "-" + self . build + ". tar.gz"
157+ filename = "cargo-{}-{}. tar.gz" . format ( channel , self . build )
158158 url = "https://static.rust-lang.org/cargo-dist/" + self .stage0_cargo_date ()
159159 tarball = os .path .join (cargo_cache , filename )
160160 if not os .path .exists (tarball ):
161- get (url + "/" + filename , tarball , verbose = self .verbose )
161+ get ("{}/{}" . format ( url , filename ) , tarball , verbose = self .verbose )
162162 unpack (tarball , self .bin_root (), match = "cargo" , verbose = self .verbose )
163163 with open (self .cargo_stamp (), 'w' ) as f :
164164 f .write (self .stage0_cargo_date ())
@@ -335,7 +335,7 @@ def build_triple(self):
335335 raise ValueError (err )
336336 sys .exit (err )
337337
338- return cputype + '-' + ostype
338+ return "{}-{}" . format ( cputype , ostype )
339339
340340def main ():
341341 parser = argparse .ArgumentParser (description = 'Build rust' )
0 commit comments