summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--pygnulib/GLEmiter.py2
-rw-r--r--pygnulib/GLTestDir.py4
3 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index a44504ae20..b052583c01 100644
--- 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.
diff --git a/pygnulib/GLEmiter.py b/pygnulib/GLEmiter.py
index 9aa638d693..e0164ed7cc 100644
--- a/pygnulib/GLEmiter.py
+++ b/pygnulib/GLEmiter.py
@@ -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.
diff --git a/pygnulib/GLTestDir.py b/pygnulib/GLTestDir.py
index f8d9910ab7..9a3fde66ea 100644
--- a/pygnulib/GLTestDir.py
+++ b/pygnulib/GLTestDir.py
@@ -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]