]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool.py: Don't perform unnecessary configure.ac scanning.
authorCollin Funk <collin.funk1@gmail.com>
Thu, 6 Jun 2024 03:21:51 +0000 (20:21 -0700)
committerCollin Funk <collin.funk1@gmail.com>
Thu, 6 Jun 2024 03:21:51 +0000 (20:21 -0700)
* pygnulib/GLImport.py (GLImport.execute): Use re.search() instead of
re.findall() since we only care about finding one match. Remove
unnecessary bool() calls.

ChangeLog
pygnulib/GLImport.py

index eec970671b96566f99811f4eba95da0d20c86a3c..3c932f4f73972c95cdf45dffc1fc46687abaf4c4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-06-05  Collin Funk  <collin.funk1@gmail.com>
+
+       gnulib-tool.py: Don't perform unnecessary configure.ac scanning.
+       * pygnulib/GLImport.py (GLImport.execute): Use re.search() instead of
+       re.findall() since we only care about finding one match. Remove
+       unnecessary bool() calls.
+
 2024-06-05  Bruno Haible  <bruno@clisp.org>
 
        setenv: On native Windows, don't modify _environ directly.
index e67cbbe5a23af2d10778cd6a1edfcab02270bce5..df541a8b7740f2e946575b2251ad1849061b7017 100644 (file)
@@ -1392,10 +1392,8 @@ in <library>_a_LDFLAGS or <library>_la_LDFLAGS when linking a library.''')
         # Detect position_early_after.
         with open(configure_ac, mode='r', newline='\n', encoding='utf-8') as file:
             data = file.read()
-        match_result1 = \
-            bool(re.compile(r'^ *AC_PROG_CC_STDC', re.M).findall(data))
-        match_result2 = \
-            bool(re.compile(r'^ *AC_PROG_CC_C99', re.M).findall(data))
+        match_result1 = re.compile(r'^ *AC_PROG_CC_STDC', re.MULTILINE).search(data)
+        match_result2 = re.compile(r'^ *AC_PROG_CC_C99', re.MULTILINE).search(data)
         if match_result1:
             print('  - replace AC_PROG_CC_STDC with AC_PROG_CC in %s,' % (configure_ac))
             position_early_after = 'AC_PROG_CC_STDC'