]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CI: use semantic version compare for determing "latest" OpenSSL
authorIlya Shipitsin <chipitsine@gmail.com>
Fri, 29 Dec 2023 22:31:39 +0000 (23:31 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 2 Jan 2024 09:23:40 +0000 (10:23 +0100)
currently "openssl-3.2.0-beta1" wins over "openssl-3.2.0" due to
string comparision. let's switch to semantic version compare

.github/matrix.py

index d5ad6931a551ba33aab63fcd39d79e61856b9063..5e01c28bb341a851949c00326fe054d090c5aaf6 100755 (executable)
@@ -14,6 +14,7 @@ import re
 import sys
 import urllib.request
 from os import environ
+from packaging import version
 
 #
 # this CI is used for both development and stable branches of HAProxy
@@ -47,7 +48,7 @@ def determine_latest_openssl(ssl):
     latest_tag = ""
     for tag in tags:
         if "openssl-" in tag:
-            if tag > latest_tag:
+            if (not latest_tag) or (version.parse(tag[8:]) > version.parse(latest_tag[8:])):
                 latest_tag = tag
     return "OPENSSL_VERSION={}".format(latest_tag[8:])