MCPcopy Index your code
hub / github.com/python/cpython / main

Function main

PCbuild/prepare_ssl.py:145–201  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

143 fix_uplink()
144
145def main():
146 if len(sys.argv) == 1:
147 print("Not enough arguments: directory containing OpenSSL",
148 "sources must be supplied")
149 sys.exit(1)
150
151 if len(sys.argv) == 3 and sys.argv[2] not in ('x86', 'amd64'):
152 print("Second argument must be x86 or amd64")
153 sys.exit(1)
154
155 if len(sys.argv) > 3:
156 print("Too many arguments supplied, all we need is the directory",
157 "containing OpenSSL sources and optionally the architecture")
158 sys.exit(1)
159
160 ssl_dir = sys.argv[1]
161 arch = sys.argv[2] if len(sys.argv) >= 3 else None
162
163 if not os.path.isdir(ssl_dir):
164 print(ssl_dir, "is not an existing directory!")
165 sys.exit(1)
166
167 # perl should be on the path, but we also look in "\perl" and "c:\\perl"
168 # as "well known" locations
169 perls = find_all_on_path("perl.exe", [r"\perl\bin",
170 r"C:\perl\bin",
171 r"\perl64\bin",
172 r"C:\perl64\bin",
173 ])
174 perl = find_working_perl(perls)
175 if perl:
176 print("Found a working perl at '%s'" % (perl,))
177 else:
178 sys.exit(1)
179 if not find_all_on_path('nmake.exe'):
180 print('Could not find nmake.exe, try running env.bat')
181 sys.exit(1)
182 if not find_all_on_path('nasm.exe'):
183 print('Could not find nasm.exe, please add to PATH')
184 sys.exit(1)
185 sys.stdout.flush()
186
187 # Put our working Perl at the front of our path
188 os.environ["PATH"] = os.path.dirname(perl) + \
189 os.pathsep + \
190 os.environ["PATH"]
191
192 old_cwd = os.getcwd()
193 try:
194 os.chdir(ssl_dir)
195 if arch:
196 prep(arch)
197 else:
198 for arch in ['amd64', 'x86']:
199 prep(arch)
200 finally:
201 os.chdir(old_cwd)
202

Callers 1

prepare_ssl.pyFile · 0.70

Calls 7

find_all_on_pathFunction · 0.85
find_working_perlFunction · 0.85
prepFunction · 0.85
exitMethod · 0.45
isdirMethod · 0.45
flushMethod · 0.45
dirnameMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…