|
46 | 46 | from tools.P4APIFtp import P4APIFtp |
47 | 47 | from tools.PlatformInfo import PlatformInfo |
48 | 48 | from tools.VersionInfo import VersionInfo |
| 49 | +from tools.P4APIHttps import P4APIHttps |
49 | 50 |
|
50 | 51 | if sys.version_info < (3, 0): |
51 | 52 | from ConfigParser import ConfigParser |
@@ -162,13 +163,16 @@ def is_super(self): |
162 | 163 | def download_p4api(self, api_ver, ssl_ver): |
163 | 164 | global loaded_lib_from_ftp |
164 | 165 |
|
165 | | - print("Looking for P4 API {0} for SSL {1} on ftp.perforce.com".format(api_ver, ssl_ver)) |
166 | | - p4ftp = P4APIFtp("perforce") |
167 | | - api_dir, api_tarball = p4ftp.load_api(api_ver, ssl_ver) |
| 166 | + print("Looking for P4 API {0} for SSL {1} on https://ftp.perforce.com".format(api_ver, ssl_ver)) |
| 167 | + |
| 168 | + g_major, g_minor = P4APIFtp.get_glib_ver(self) |
| 169 | + p4https = P4APIHttps() |
| 170 | + url = p4https.get_url(g_minor, ssl_ver, api_ver) |
| 171 | + api_dir, api_tarball= p4https.get_file(url) |
168 | 172 | print("Extracted {0} into {1}".format(api_tarball, api_dir)) |
169 | 173 |
|
170 | 174 | loaded_lib_from_ftp = True |
171 | | - return api_dir, api_tarball |
| 175 | + return api_dir |
172 | 176 |
|
173 | 177 | # run strings on p4api librpc.a to get the version of OpenSSL needed |
174 | 178 | def get_ssl_version_from_p4api(self): |
@@ -229,7 +233,10 @@ def check_installed_ssl(): |
229 | 233 | match = pattern.match(version_string) |
230 | 234 | if match: |
231 | 235 | version = int(match.group(1)) * 100 + int(match.group(2)) * 10 + int(match.group(3)) * 1 |
232 | | - ver_only = str(match.group(1)) + "." + str(match.group(2)) + "." + str(match.group(3)) + str(match.group(4)) |
| 236 | + if str(match.group(4) is None): |
| 237 | + ver_only = str(match.group(1)) + "." + str(match.group(2)) + "." + str(match.group(3)) |
| 238 | + else: |
| 239 | + ver_only = str(match.group(1)) + "." + str(match.group(2)) + "." + str(match.group(3)) + str(match.group(4)) |
233 | 240 | if version >= MIN_SSL_VERSION: |
234 | 241 | release = match.group(4) |
235 | 242 | for p in os.environ["PATH"].split(os.pathsep): |
@@ -295,7 +302,7 @@ def run(self, *args, **kwargs): |
295 | 302 | if not p4_api_dir: |
296 | 303 | if (not self.apidir) and (sys.platform == "linux" or sys.platform == "linux2"): |
297 | 304 | # Attempt to download P4 API which matches our versions |
298 | | - (self.apidir, api_tarball) = self.download_p4api(VersionInfo(".").getVersion(), ssl_ver) |
| 305 | + self.apidir = self.download_p4api(VersionInfo(".").getVersion(), ssl_ver) |
299 | 306 | p4_api_dir = self.apidir |
300 | 307 |
|
301 | 308 | if not self.apidir: |
|
0 commit comments