Author: jun66j5
Date: Fri Nov  7 02:41:02 2025
New Revision: 1929564

Log:
Adapt gen_win_dependencies.py to expat 2.7.2+.

* build/generator/gen_win_dependencies.py
  (GenDependenciesBase._find_apr,
   GenDependenciesBase._find_apr_util_etc,
   GenDependenciesBase._find_httpd,
   GenDependenciesBase._find_zlib,
   GenDependenciesBase._find_openssl,
   GenDependenciesBase._find_sasl,
   GenDependenciesBase._find_libintl,
   GenDependenciesBase._find_sqlite,
   GenDependenciesBase._find_lz4,
   GenDependenciesBase._find_utf8proc):
   Allow whitespace characters between `#` and `define` when detecting version
   macros in the header files.

Modified:
   subversion/trunk/build/generator/gen_win_dependencies.py

Modified: subversion/trunk/build/generator/gen_win_dependencies.py
==============================================================================
--- subversion/trunk/build/generator/gen_win_dependencies.py    Fri Nov  7 
02:39:40 2025        (r1929563)
+++ subversion/trunk/build/generator/gen_win_dependencies.py    Fri Nov  7 
02:41:02 2025        (r1929564)
@@ -376,13 +376,16 @@ class GenDependenciesBase(gen_base.Gener
     version_file_path = os.path.join(inc_path, 'apr_version.h')
     txt = open(version_file_path).read()
 
-    vermatch = re.search(r'^\s*#define\s+APR_MAJOR_VERSION\s+(\d+)', txt, re.M)
+    vermatch = re.search(r'^\s*#\s*define\s+APR_MAJOR_VERSION\s+(\d+)',
+                         txt, re.M)
     major = int(vermatch.group(1))
 
-    vermatch = re.search(r'^\s*#define\s+APR_MINOR_VERSION\s+(\d+)', txt, re.M)
+    vermatch = re.search(r'^\s*#\s*define\s+APR_MINOR_VERSION\s+(\d+)',
+                         txt, re.M)
     minor = int(vermatch.group(1))
 
-    vermatch = re.search(r'^\s*#define\s+APR_PATCH_VERSION\s+(\d+)', txt, re.M)
+    vermatch = re.search(r'^\s*#\s*define\s+APR_PATCH_VERSION\s+(\d+)',
+                         txt, re.M)
     patch = int(vermatch.group(1))
 
     version = (major, minor, patch)
@@ -479,13 +482,16 @@ class GenDependenciesBase(gen_base.Gener
     version_file_path = os.path.join(inc_path, 'apu_version.h')
     txt = open(version_file_path).read()
 
-    vermatch = re.search(r'^\s*#define\s+APU_MAJOR_VERSION\s+(\d+)', txt, re.M)
+    vermatch = re.search(r'^\s*#\s*define\s+APU_MAJOR_VERSION\s+(\d+)',
+                         txt, re.M)
     major = int(vermatch.group(1))
 
-    vermatch = re.search(r'^\s*#define\s+APU_MINOR_VERSION\s+(\d+)', txt, re.M)
+    vermatch = re.search(r'^\s*#\s*define\s+APU_MINOR_VERSION\s+(\d+)',
+                         txt, re.M)
     minor = int(vermatch.group(1))
 
-    vermatch = re.search(r'^\s*#define\s+APU_PATCH_VERSION\s+(\d+)', txt, re.M)
+    vermatch = re.search(r'^\s*#\s*define\s+APU_PATCH_VERSION\s+(\d+)',
+                         txt, re.M)
     patch = int(vermatch.group(1))
 
     version = (major, minor, patch)
@@ -590,13 +596,16 @@ class GenDependenciesBase(gen_base.Gener
 
     txt = open(version_file_path).read()
 
-    vermatch = re.search(r'^\s*#define\s+XML_MAJOR_VERSION\s+(\d+)', txt, re.M)
+    vermatch = re.search(r'^\s*#\s*define\s+XML_MAJOR_VERSION\s+(\d+)',
+                         txt, re.M)
     major = int(vermatch.group(1))
 
-    vermatch = re.search(r'^\s*#define\s+XML_MINOR_VERSION\s+(\d+)', txt, re.M)
+    vermatch = re.search(r'^\s*#\s*define\s+XML_MINOR_VERSION\s+(\d+)',
+                         txt, re.M)
     minor = int(vermatch.group(1))
 
-    vermatch = re.search(r'^\s*#define\s+XML_MICRO_VERSION\s+(\d+)', txt, re.M)
+    vermatch = re.search(r'^\s*#\s*define\s+XML_MICRO_VERSION\s+(\d+)',
+                         txt, re.M)
     patch = int(vermatch.group(1))
 
     # apr-Util 0.9-1.4 compiled expat to 'xml.lib', but apr-util 1.5 switched
@@ -650,16 +659,16 @@ class GenDependenciesBase(gen_base.Gener
     version_file_path = os.path.join(inc_path, 'ap_release.h')
     txt = open(version_file_path).read()
 
-    vermatch = 
re.search(r'^\s*#define\s+AP_SERVER_MAJORVERSION_NUMBER\s+(\d+)',
-                         txt, re.M)
+    vermatch = re.search(r'^\s*#\s*define\s+AP_SERVER_MAJORVERSION_NUMBER'
+                         r'\s+(\d+)', txt, re.M)
     major = int(vermatch.group(1))
 
-    vermatch = 
re.search(r'^\s*#define\s+AP_SERVER_MINORVERSION_NUMBER\s+(\d+)',
-                         txt, re.M)
+    vermatch = re.search(r'^\s*#\s*define\s+AP_SERVER_MINORVERSION_NUMBER'
+                         r'\s+(\d+)', txt, re.M)
     minor = int(vermatch.group(1))
 
-    vermatch = re.search(r'^\s*#define\s+AP_SERVER_PATCHLEVEL_NUMBER\s+(\d+)',
-                         txt, re.M)
+    vermatch = re.search(r'^\s*#\s*define\s+AP_SERVER_PATCHLEVEL_NUMBER'
+                         r'\s+(\d+)', txt, re.M)
     patch = int(vermatch.group(1))
 
     version = (major, minor, patch)
@@ -769,8 +778,8 @@ class GenDependenciesBase(gen_base.Gener
 
     txt = open(version_file_path).read()
     vermatch = re.search(
-                r'^\s*#define\s+ZLIB_VERSION\s+"(\d+(?:\.\d+){1,3})(?:-\w+)?"',
-                 txt, re.M)
+        r'^\s*#\s*define\s+ZLIB_VERSION\s+"(\d+(?:\.\d+){1,3})(?:-\w+)?"',
+        txt, re.M)
 
     version = tuple(map(int, vermatch.group(1).split('.')))
     self.zlib_version = '.'.join(map(str, version))
@@ -1396,13 +1405,16 @@ class GenDependenciesBase(gen_base.Gener
 
     txt = open(version_file_path).read()
 
-    vermatch = re.search(r'^\s*#define\s+SASL_VERSION_MAJOR\s+(\d+)', txt, 
re.M)
+    vermatch = re.search(r'^\s*#\s*define\s+SASL_VERSION_MAJOR\s+(\d+)',
+                         txt, re.M)
     major = int(vermatch.group(1))
 
-    vermatch = re.search(r'^\s*#define\s+SASL_VERSION_MINOR\s+(\d+)', txt, 
re.M)
+    vermatch = re.search(r'^\s*#\s*define\s+SASL_VERSION_MINOR\s+(\d+)',
+                         txt, re.M)
     minor = int(vermatch.group(1))
 
-    vermatch = re.search(r'^\s*#define\s+SASL_VERSION_STEP\s+(\d+)', txt, re.M)
+    vermatch = re.search(r'^\s*#\s*define\s+SASL_VERSION_STEP\s+(\d+)',
+                         txt, re.M)
     patch = int(vermatch.group(1))
 
     version = (major, minor, patch)
@@ -1470,8 +1482,8 @@ class GenDependenciesBase(gen_base.Gener
     version_file_path = os.path.join(inc_dir, 'libintl.h')
     txt = open(version_file_path).read()
 
-    match = re.search(r'^\s*#define\s+LIBINTL_VERSION\s+((0x)?[0-9A-Fa-f]+)',
-                      txt, re.M)
+    match = re.search(r'^\s*#\s*define\s+LIBINTL_VERSION\s+'
+                      r'((0x)?[0-9A-Fa-f]+)', txt, re.M)
 
     ver = int(match.group(1), 0)
     version = (ver >> 16, (ver >> 8) & 0xFF, ver & 0xFF)
@@ -1543,7 +1555,7 @@ class GenDependenciesBase(gen_base.Gener
 
     txt = open(version_file_path).read()
 
-    match = re.search(r'^\s*#define\s+SQLITE_VERSION\s+'
+    match = re.search(r'^\s*#\s*define\s+SQLITE_VERSION\s+'
                       r'"(\d+)\.(\d+)\.(\d+)(?:\.(\d))?"', txt, re.M)
 
     version = match.groups()
@@ -1577,15 +1589,15 @@ class GenDependenciesBase(gen_base.Gener
                                      'lz4', 'lz4internal.h')
     txt = open(version_file_path).read()
 
-    vermatch = re.search(r'^\s*#define\s+LZ4_VERSION_MAJOR\s+(\d+)',
+    vermatch = re.search(r'^\s*#\s*define\s+LZ4_VERSION_MAJOR\s+(\d+)',
                          txt, re.M)
     major = int(vermatch.group(1))
 
-    vermatch = re.search(r'^\s*#define\s+LZ4_VERSION_MINOR\s+(\d+)',
+    vermatch = re.search(r'^\s*#\s*define\s+LZ4_VERSION_MINOR\s+(\d+)',
                          txt, re.M)
     minor = int(vermatch.group(1))
 
-    vermatch = re.search(r'^\s*#define\s+LZ4_VERSION_RELEASE\s+(\d+)',
+    vermatch = re.search(r'^\s*#\s*define\s+LZ4_VERSION_RELEASE\s+(\d+)',
                          txt, re.M)
     rel = vermatch.group(1)
 
@@ -1602,15 +1614,15 @@ class GenDependenciesBase(gen_base.Gener
                                      'utf8proc', 'utf8proc_internal.h')
     txt = open(version_file_path).read()
 
-    vermatch = re.search(r'^\s*#define\s+UTF8PROC_VERSION_MAJOR\s+(\d+)',
+    vermatch = re.search(r'^\s*#\s*define\s+UTF8PROC_VERSION_MAJOR\s+(\d+)',
                          txt, re.M)
     major = int(vermatch.group(1))
 
-    vermatch = re.search(r'^\s*#define\s+UTF8PROC_VERSION_MINOR\s+(\d+)',
+    vermatch = re.search(r'^\s*#\s*define\s+UTF8PROC_VERSION_MINOR\s+(\d+)',
                          txt, re.M)
     minor = int(vermatch.group(1))
 
-    vermatch = re.search(r'^\s*#define\s+UTF8PROC_VERSION_PATCH\s+(\d+)',
+    vermatch = re.search(r'^\s*#\s*define\s+UTF8PROC_VERSION_PATCH\s+(\d+)',
                          txt, re.M)
     patch = int(vermatch.group(1))
 

Reply via email to