summaryrefslogtreecommitdiff
path: root/pygnulib
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2022-08-07 13:46:15 +0200
committerBruno Haible <bruno@clisp.org>2022-08-07 23:04:11 +0200
commit5c087011efa2817a7e857f69a1cdd22c21a5053d (patch)
tree552d99091fbdeda40756c360ae70eac81da9f7bf /pygnulib
parent9d722ddced2e46a06255be8eb24a54015f611af7 (diff)
downloadgnulib-5c087011efa2817a7e857f69a1cdd22c21a5053d.tar.gz
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. * pygnulib/GLEmiter.py (GLEmiter.autoconfSnippet): Likewise.
Diffstat (limited to 'pygnulib')
-rw-r--r--pygnulib/GLEmiter.py2
-rw-r--r--pygnulib/GLModuleSystem.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/pygnulib/GLEmiter.py b/pygnulib/GLEmiter.py
index 02fa6654e7..9aa638d693 100644
--- a/pygnulib/GLEmiter.py
+++ b/pygnulib/GLEmiter.py
@@ -174,7 +174,7 @@ class GLEmiter(object):
else:
# Don't indent AM_GNU_GETTEXT_VERSION line, as that confuses
# autopoint through at least GNU gettext version 0.18.2.
- snippet = re.compile('^ *AM_GNU_GETTEXT_VERSION').sub('AM_GNU_GETTEXT_VERSION', snippet)
+ snippet = re.compile('^ *AM_GNU_GETTEXT_VERSION', re.M).sub('AM_GNU_GETTEXT_VERSION', snippet)
emit += snippet
if str(module) == 'alloca' and libtool and not disable_libtool:
emit += 'changequote(,)dnl\n'
diff --git a/pygnulib/GLModuleSystem.py b/pygnulib/GLModuleSystem.py
index e1b62ec56c..75316515b8 100644
--- a/pygnulib/GLModuleSystem.py
+++ b/pygnulib/GLModuleSystem.py
@@ -1041,7 +1041,7 @@ class GLModuleTable(object):
if self.config['conddeps']:
automake_snippet = \
module.getAutomakeSnippet_Conditional()
- pattern = re.compile('^if')
+ pattern = re.compile('^if', re.M)
if not pattern.findall(automake_snippet):
self.addUnconditional(module)
conditional = self.isConditional(module)