From 5c087011efa2817a7e857f69a1cdd22c21a5053d Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 7 Aug 2022 13:46:15 +0200 Subject: 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. --- pygnulib/GLEmiter.py | 2 +- pygnulib/GLModuleSystem.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'pygnulib') 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) -- cgit v1.2.1