]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-38820: Old OpenSSL 3.0.0 releases are in /old/3.0/ (GH-25624)
authorChristian Heimes <christian@python.org>
Mon, 26 Apr 2021 08:54:12 +0000 (10:54 +0200)
committerGitHub <noreply@github.com>
Mon, 26 Apr 2021 08:54:12 +0000 (10:54 +0200)
Signed-off-by: Christian Heimes <christian@python.org>
Tools/ssl/multissltests.py

index dc47c5ce12cfa10ed2ae9dbd73f4c755f7202c1b..24d70ac6e4015e2a43f492017b047148d587f8a8 100755 (executable)
@@ -33,6 +33,7 @@ try:
     from urllib.error import HTTPError
 except ImportError:
     from urllib2 import urlopen, HTTPError
+import re
 import shutil
 import string
 import subprocess
@@ -448,11 +449,14 @@ class BuildOpenSSL(AbstractBuilder):
     @property
     def short_version(self):
         """Short version for OpenSSL download URL"""
-        short_version = self.version.rstrip(string.ascii_letters)
-        if short_version.startswith("0.9"):
-            short_version = "0.9.x"
-        return short_version
-
+        mo = re.search(r"^(\d+)\.(\d+)\.(\d+)", self.version)
+        parsed = tuple(int(m) for m in mo.groups())
+        if parsed < (1, 0, 0):
+            return "0.9.x"
+        if parsed >= (3, 0, 0):
+            # OpenSSL 3.0.0 -> /old/3.0/
+            parsed = parsed[:2]
+        return ".".join(str(i) for i in parsed)
 
 class BuildLibreSSL(AbstractBuilder):
     library = "LibreSSL"