bin/checkExternalLibraries.py |   51 ++++++++++++++----------------------------
 1 file changed, 17 insertions(+), 34 deletions(-)

New commits:
commit a90a55180178488876abab89de3c89e87f846109
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Fri May 2 14:12:34 2025 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Fri May 2 16:40:01 2025 +0200

    checkExternalLibraries: map zstd and simplify
    
    Change-Id: I899176a4c3813b6c276b4edef22bcaeda35ee681
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184904
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/bin/checkExternalLibraries.py b/bin/checkExternalLibraries.py
index ad66346f00ec..3be1b7cf4319 100755
--- a/bin/checkExternalLibraries.py
+++ b/bin/checkExternalLibraries.py
@@ -21,6 +21,20 @@ postgres_branch = ""
 mariadb_branch = ""
 libxml2_branch = ""
 
+libraryIds = {
+    "openssl": 2,
+    "curl": 1,
+    "libpng": 4,
+    "freetype": 2,
+    "lcms2": 1,
+    "cairo": 1,
+    "bzip2": 1,
+    "zlib": 1,
+    "libwebp": 1,
+    "libffi": 1,
+    "zstd": 1
+}
+
 def get_current_version(libName):
     libraryName = libName.replace("_", ".")
     libraryName = re.sub("[0-9a-f]{5,40}", "", libraryName) #SHA1
@@ -112,38 +126,10 @@ def get_latest_version(libName):
         libName = libName.split("-")[0]
 
     item = 0
-    itemId = 0
     latest_version = 0
-    if libName == "openssl":
-        item = 2
-        itemId = 2566
-    elif libName == "curl":
-        item = 1
-        itemId = 381
-    elif libName == "libpng":
-        item = 4
-        itemId = 1705
-    elif libName == "freetype":
-        item = 2
-        itemId = 854
-    elif libName == "lcms2":
-        item = 1
-        itemId = 9815
-    elif libName == "cairo":
-        item = 1
-        itemId = 247
-    elif libName == "bzip2":
-        item = 1
-        itemId = 237
-    elif libName == "zlib":
-        item = 1
-        itemId = 5303
-    elif libName == "libwebp":
-        item = 1
-        itemId = 1761
-    elif libName == "libffi":
-        item = 1
-        itemId = 1611
+
+    if libName in libraryIds:
+        item = libraryIds[libName]
 
     urlApi = "https://release-monitoring.org/api/v2/projects/?name="; + libName
     res = requests.get(urlApi)
@@ -151,9 +137,6 @@ def get_latest_version(libName):
     if not json['items']:
         return Version("0.0.0"), ""
 
-    if item != 0:
-        assert json['items'][item]['id'] == itemId, 
str(json['items'][item]['id']) + " != " + str(itemId)
-
     if libName == "openssl":
         for idx, ver in enumerate(json['items'][item]['stable_versions']):
             if ver.startswith(openssl_branch):

Reply via email to