]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool.py: Fix some regexes.
authorBruno Haible <bruno@clisp.org>
Sun, 7 Aug 2022 11:49:49 +0000 (13:49 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 7 Aug 2022 21:04:14 +0000 (23:04 +0200)
* pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): Use an equivalent
regex as gnulib-tool.
* pygnulib/GLTestDir.py (GLTestDir.execute): Likewise.

ChangeLog
pygnulib/GLEmiter.py
pygnulib/GLTestDir.py

index a44504ae20887a1bcbf0a44b0e25cd6c26762586..b052583c01dc51ce2d2570162d0891e35469179c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2022-08-07  Bruno Haible  <bruno@clisp.org>
 
+       gnulib-tool.py: Fix some regexes.
+       * pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): Use an equivalent
+       regex as gnulib-tool.
+       * pygnulib/GLTestDir.py (GLTestDir.execute): Likewise.
+
        gnulib-tool.py: Fix some regex uses.
        * pygnulib/GLModuleSystem.py (GLModuleTable.transitive_closure): Match
        the regex against all lines of the snippet, not only the first line.
index 9aa638d693625b39906026ccbddaeb38f8561395..e0164ed7cc17f7d2561035a9824ffec43cf39324 100644 (file)
@@ -801,7 +801,7 @@ AC_DEFUN([%V1%_LIBSOURCES], [
         # First test if allsnippets already specify an installation location.
         insnippets = False
         inmakefile = False
-        regex = '^[a-zA-Z0-9_]*_%sLIBRARIES *\\+{0,1}= *%s.%s' % (perhapsLT, libname, libext)
+        regex = '^[a-zA-Z0-9_]*_%sLIBRARIES *\\+{0,1}= *%s\\.%s' % (perhapsLT, libname, libext)
         pattern = re.compile(regex, re.M)
         insnippets = bool(pattern.findall(allsnippets))
         # Then test if $sourcebase/Makefile.am (if it exists) specifies it.
index f8d9910ab74951736e7130a1ba85c471f887a5b8..9a3fde66ea406dd8fe8186589e68e42cc1b07db7 100644 (file)
@@ -461,7 +461,7 @@ class GLTestDir(object):
                                   for line in snippet.split('\n')
                                   if line.strip() ]
                         snippet = '\n'.join(lines)
-                        pattern = re.compile('AC_REQUIRE\\(\\[([^()].*)\\]\\)', re.M)
+                        pattern = re.compile('AC_REQUIRE\\(\\[([^()]*)\\]\\)', re.M)
                         snippet = pattern.sub('\\1', snippet)
                         snippet = snippet.strip()
                         snippets += [snippet]
@@ -578,7 +578,7 @@ class GLTestDir(object):
                           for line in snippet.split('\n')
                           if line.strip() ]
                 snippet = '\n'.join(lines)
-                pattern = re.compile('AC_REQUIRE\\(\\[([^()].*)\\]\\)', re.M)
+                pattern = re.compile('AC_REQUIRE\\(\\[([^()]*)\\]\\)', re.M)
                 snippet = pattern.sub('\\1', snippet)
                 snippet = snippet.strip()
                 snippets += [snippet]