26
26
print "msi: " + str (make_msi )
27
27
print
28
28
29
- if target == None :
29
+ if target is None :
30
30
print "specify --target"
31
31
sys .exit (1 )
32
32
@@ -53,7 +53,7 @@ def run(args):
53
53
# The names of the packages that need to be combined via rust-installer
54
54
components = [RUSTC_PACKAGE_NAME , "cargo" , "rust-docs" ]
55
55
if "pc-windows-gnu" in target :
56
- components += [ "rust-mingw" ]
56
+ components . append ( "rust-mingw" )
57
57
58
58
# Now find the names of the tarballs that belong to those components
59
59
inputs = []
@@ -77,7 +77,7 @@ def run(args):
77
77
if not component_installer :
78
78
print "unable to find installer for component " + component + ", target " + target
79
79
sys .exit (1 )
80
- inputs += [ INPUT_DIR + "/" + component_installer ]
80
+ inputs . append ( INPUT_DIR + "/" + component_installer )
81
81
82
82
# Extract the version from the filename
83
83
if component == RUSTC_PACKAGE_NAME :
@@ -93,9 +93,9 @@ def run(args):
93
93
mingw_installer = component_installer
94
94
95
95
96
- assert version != None
97
- assert rustc_installer != None
98
- assert source_tarball != None
96
+ assert version is not None
97
+ assert rustc_installer is not None
98
+ assert source_tarball is not None
99
99
100
100
# Set up the overlay of license info
101
101
run (["tar" , "xzf" , INPUT_DIR + "/" + rustc_installer , "-C" , TEMP_DIR , ])
@@ -123,15 +123,13 @@ def run(args):
123
123
"--legacy-manifest-dirs=rustlib,cargo" ,
124
124
"--input-tarballs=" + tarball_list ,
125
125
"--non-installed-overlay=" + overlay_dir
126
- ])
126
+ ])
127
127
128
128
# Everything below here is used for producing non-rust-installer packaging
129
129
130
130
# Create the LICENSE.txt file used in some GUI installers
131
131
license_file = TEMP_DIR + "/LICENSE.txt"
132
- cmd = "cat " + \
133
- rustc_dir + "/COPYRIGHT " + rustc_dir + "/LICENSE-APACHE " + rustc_dir + "/LICENSE-MIT " + \
134
- "> " + license_file
132
+ cmd = "cat {0}/COPYRIGHT {0}/LICENSE-APACHE {0}/LICENSE-MIT > {1}" .format (rustc_dir , license_file )
135
133
run (["sh" , "-c" , cmd ])
136
134
137
135
# Fish out the following Makefile variables from the source code or rebuild them somehow.
@@ -147,19 +145,19 @@ def run(args):
147
145
source_dir = os .path .join (TEMP_DIR , source_tarball .replace ("-src.tar.gz" , "" ))
148
146
149
147
for line in open (source_dir + "/mk/main.mk" ):
150
- if "CFG_RELEASE_NUM" in line and CFG_RELEASE_NUM == None :
148
+ if "CFG_RELEASE_NUM" in line and CFG_RELEASE_NUM is None :
151
149
CFG_RELEASE_NUM = line .split ("=" )[1 ].strip ()
152
150
assert len (CFG_RELEASE_NUM ) > 0
153
- if "CFG_BETA_CYCLE" in line and CFG_BETA_CYCLE == None :
151
+ if "CFG_BETA_CYCLE" in line and CFG_BETA_CYCLE is None :
154
152
CFG_BETA_CYCLE = line .split ("=" )[1 ].strip ()
155
153
# NB: This can be an empty string
156
154
157
- assert CFG_RELEASE_NUM != None
155
+ assert CFG_RELEASE_NUM is not None
158
156
159
157
# FIXME Temporary hack
160
- if CFG_BETA_CYCLE == None :
158
+ if CFG_BETA_CYCLE is None :
161
159
CFG_BETA_CYCLE = ""
162
- assert CFG_BETA_CYCLE != None
160
+ assert CFG_BETA_CYCLE is not None
163
161
164
162
# Guess the channel from the source tarball
165
163
channel = None
@@ -216,9 +214,9 @@ def run(args):
216
214
217
215
if make_exe :
218
216
print "creating .exe"
219
- assert docs_installer != None
220
- assert mingw_installer != None
221
- assert cargo_installer != None
217
+ assert docs_installer is not None
218
+ assert mingw_installer is not None
219
+ assert cargo_installer is not None
222
220
exe_temp_dir = TEMP_DIR + "/exe"
223
221
os .mkdir (exe_temp_dir )
224
222
run (["tar" , "xzf" , INPUT_DIR + "/" + rustc_installer , "-C" , exe_temp_dir ])
0 commit comments