bin/checkExternalLibraries.py |   94 +++++++++++++++++++++---------------------
 1 file changed, 49 insertions(+), 45 deletions(-)

New commits:
commit 86b9bad32b04860a4d6738ba506b61adb9042625
Author:     Xisco Fauli <[email protected]>
AuthorDate: Wed Oct 29 17:48:05 2025 +0100
Commit:     Xisco Fauli <[email protected]>
CommitDate: Wed Oct 29 20:58:58 2025 +0100

    checkExternalLibraries: some improvements to the script
    
    Also check y-crdt, sqlite3 and reem-kufi libraries
    
    Change-Id: Ie4534de2ab241924df1a056bc857ce1ee8d231b3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193159
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/bin/checkExternalLibraries.py b/bin/checkExternalLibraries.py
index 623acc652fd0..09ef07b03cfa 100755
--- a/bin/checkExternalLibraries.py
+++ b/bin/checkExternalLibraries.py
@@ -34,12 +34,41 @@ libraryIds = {
     "zstd": 1
 }
 
+libraryNames = {
+    "boost": "boost",
+    "java-websocket": "java-websocket",
+    "phc-winner-argon2": "argon2",
+    "libe-book": "libe-book",
+    "zxcvbn-c": "zxcvbn-c",
+    "libjpeg-turbo": "libjpeg-turbo",
+    "poppler-data": "poppler-data",
+    "libgpg-error": "libgpg-error",
+    "mariadb-connector-c": "mariadb-connector-c",
+    "tiff": "libtiff",
+    "zxing": "zxing-cpp",
+    "liborcus": "orcus",
+    "ltm": "libtommath",
+    "clucene-core": "clucene-core",
+    "lp_solve": "lp_solve",
+    "hsqldb": "hsqldb",
+    "y-crdt": "y-crdt",
+    "sqlite": "sqlite",
+    "reemkufi": "aliftype-reem-kufi-fonts",
+}
+
 def get_current_version(libName):
-    libraryName = libName.replace("_", ".")
-    libraryName = re.sub("[0-9a-f]{5,40}", "", libraryName) #SHA1
-    s = re.search("\d[\d\.]+\d", libraryName )
-    if s:
-        return parse(s.group())
+    if "sqlite" in libName:
+        # 3XXYYZZ -> 3.X.Y.Z
+        s = re.search("(\d{7})", libName )
+        if s:
+            num = str(s.group(1))
+            return parse("{}.{}.{}.{}".format(num[0], num[1:3], num[3:5], 
num[6:7]))
+    else:
+        libraryName = libName.replace("_", ".")
+        libraryName = re.sub("[0-9a-f]{5,40}", "", libraryName) #SHA1
+        s = re.search("\d[\d\.]+\d", libraryName )
+        if s:
+            return parse(s.group())
 
     return Version("0.0.0")
 
@@ -56,7 +85,7 @@ def get_library_list(fileName):
             continue
 
         # FIXME
-        if "FONT_" in variableName:
+        if "FONT_" in variableName and "REEM" not in variableName:
             continue
 
         libraryName = decodedName.split("=")[1]
@@ -80,45 +109,20 @@ def get_library_list(fileName):
     return libraryList
 
 def get_latest_version(libName):
-
-    if libName.startswith("boost"):
-        libName = "boost"
-    elif libName.startswith("java-websocket"):
-        libName = "java-websocket"
-    elif libName.startswith("phc-winner-argon2"):
-        libName = "argon2"
-    elif libName.startswith("libe-book"):
-        libName = "libe-book"
-    elif libName.startswith("zxcvbn-c"):
-        libName = "zxcvbn-c"
-    elif libName.startswith("libjpeg-turbo"):
-        libName = "libjpeg-turbo"
-    elif libName.startswith("poppler-data"):
-        libName = "poppler-data"
-    elif libName.startswith("libgpg-error"):
-        libName = "libgpg-error"
-    elif libName.startswith("mariadb-connector-c"):
-        libName = "mariadb-connector-c"
-    elif libName.startswith("postgresql"):
-        libName = "postgresql%20" + str(postgres_branch) + ".x"
-    elif libName.startswith("tiff"):
-        libName = "libtiff"
-    elif libName.startswith("zxing"):
-        libName = "zxing-cpp"
-    elif libName.startswith("liborcus"):
-        libName = "orcus"
-    elif libName.startswith("ltm"):
-        libName = "libtommath"
-    elif "clucene-core" in libName:
-        libName = "clucene-core"
-    elif "lp_solve" in libName:
-        libName = "lp_solve"
-    elif "hsqldb" in libName:
-        libName = "hsqldb"
-    elif re.match("[0-9a-f]{5,40}", libName.split("-")[0]): # SHA1
-        libName = libName.split("-")[1]
-    else:
-        libName = libName.split("-")[0]
+    bFound = False
+    for k,v in libraryNames.items():
+        if k in libName:
+            libName = v
+            bFound = True
+            break
+
+    if not bFound:
+        if libName.startswith("postgresql"):
+            libName = "postgresql%20" + str(postgres_branch) + ".x"
+        elif re.match("[0-9a-f]{5,40}", libName.split("-")[0]): # SHA1
+            libName = libName.split("-")[1]
+        else:
+            libName = libName.split("-")[0]
 
     item = 0
     latest_version = 0

Reply via email to