@@ -30,7 +30,7 @@ def get(url, path, verbose=False):
30
30
download (sha_path , sha_url , verbose )
31
31
download (temp_path , url , verbose )
32
32
verify (temp_path , sha_path , verbose )
33
- print ("moving " + temp_path + " to " + path )
33
+ print ("moving {} to {}" . format ( temp_path , path ) )
34
34
shutil .move (temp_path , path )
35
35
finally :
36
36
delete_if_present (sha_path )
@@ -44,7 +44,7 @@ def delete_if_present(path):
44
44
45
45
46
46
def download (path , url , verbose ):
47
- print ("downloading " + url + " to " + path )
47
+ print ("downloading {} to {}" . format ( url , path ) )
48
48
# see http://serverfault.com/questions/301128/how-to-download
49
49
if sys .platform == 'win32' :
50
50
run (["PowerShell.exe" , "/nologo" , "-Command" ,
@@ -133,32 +133,32 @@ def download_stage0(self):
133
133
if os .path .exists (self .bin_root ()):
134
134
shutil .rmtree (self .bin_root ())
135
135
channel = self .stage0_rustc_channel ()
136
- filename = "rust-std-" + channel + "-" + self . build + ". tar.gz"
136
+ filename = "rust-std-{}-{}. tar.gz" . format ( channel , self . build )
137
137
url = "https://static.rust-lang.org/dist/" + self .stage0_rustc_date ()
138
138
tarball = os .path .join (rustc_cache , filename )
139
139
if not os .path .exists (tarball ):
140
- get (url + "/" + filename , tarball , verbose = self .verbose )
140
+ get ("{}/{}" . format ( url , filename ) , tarball , verbose = self .verbose )
141
141
unpack (tarball , self .bin_root (),
142
142
match = "rust-std-" + self .build ,
143
143
verbose = self .verbose )
144
144
145
- filename = "rustc-" + channel + "-" + self . build + ". tar.gz"
145
+ filename = "rustc-{}-{}. tar.gz" . format ( channel , self . build )
146
146
url = "https://static.rust-lang.org/dist/" + self .stage0_rustc_date ()
147
147
tarball = os .path .join (rustc_cache , filename )
148
148
if not os .path .exists (tarball ):
149
- get (url + "/" + filename , tarball , verbose = self .verbose )
149
+ get ("{}/{}" . format ( url , filename ) , tarball , verbose = self .verbose )
150
150
unpack (tarball , self .bin_root (), match = "rustc" , verbose = self .verbose )
151
151
with open (self .rustc_stamp (), 'w' ) as f :
152
152
f .write (self .stage0_rustc_date ())
153
153
154
154
if self .cargo ().startswith (self .bin_root ()) and \
155
155
(not os .path .exists (self .cargo ()) or self .cargo_out_of_date ()):
156
156
channel = self .stage0_cargo_channel ()
157
- filename = "cargo-" + channel + "-" + self . build + ". tar.gz"
157
+ filename = "cargo-{}-{}. tar.gz" . format ( channel , self . build )
158
158
url = "https://static.rust-lang.org/cargo-dist/" + self .stage0_cargo_date ()
159
159
tarball = os .path .join (cargo_cache , filename )
160
160
if not os .path .exists (tarball ):
161
- get (url + "/" + filename , tarball , verbose = self .verbose )
161
+ get ("{}/{}" . format ( url , filename ) , tarball , verbose = self .verbose )
162
162
unpack (tarball , self .bin_root (), match = "cargo" , verbose = self .verbose )
163
163
with open (self .cargo_stamp (), 'w' ) as f :
164
164
f .write (self .stage0_cargo_date ())
@@ -335,7 +335,7 @@ def build_triple(self):
335
335
raise ValueError (err )
336
336
sys .exit (err )
337
337
338
- return cputype + '-' + ostype
338
+ return "{}-{}" . format ( cputype , ostype )
339
339
340
340
def main ():
341
341
parser = argparse .ArgumentParser (description = 'Build rust' )
0 commit comments