]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
gnulib-tool.py: Fix determination whether to add the dummy module.
authorCollin Funk <collin.funk1@gmail.com>
Tue, 2 Apr 2024 11:41:22 +0000 (04:41 -0700)
committerBruno Haible <bruno@clisp.org>
Tue, 2 Apr 2024 14:35:15 +0000 (16:35 +0200)
* pygnulib/GLModuleSystem.py (GLModuleSystem.add_dummy): Only match the
'lib_SOURCES' variable; stop at end-of-line.

ChangeLog
pygnulib/GLModuleSystem.py

index c6ccc0f737fcba5d5865cae0e9601e231a7a8f7a..6e6ebb612748f68dcaea251795b64cff20abe00f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-04-02  Collin Funk  <collin.funk1@gmail.com>
+
+       gnulib-tool.py: Fix determination whether to add the dummy module.
+       * pygnulib/GLModuleSystem.py (GLModuleSystem.add_dummy): Only match the
+       'lib_SOURCES' variable; stop at end-of-line.
+
 2024-04-02  Pádraig Brady  <P@draigBrady.com>
 
        renameatu: handle ENOSYS from renameatx_np
index c406dcb6e384d72cd21e1dfbb22056f9af80b300..f02f369f0e8ecf5eed7921213b618dd5bc7f75b8 100644 (file)
@@ -1031,9 +1031,9 @@ class GLModuleTable(object):
                     # Extract the value of unconditional "lib_SOURCES += ..." augmentations.
                     snippet = combine_lines(snippet)
                     snippet = self.remove_if_blocks(snippet)
-                    pattern = re.compile(r'^lib_SOURCES[\t ]*\+=([^#]*).*$', re.M)
-                    for matching_rhs in pattern.findall(snippet):
-                        files = matching_rhs.split(' ')
+                    pattern = re.compile(r'^lib_SOURCES[\t ]*\+=[\t ]*([^#]+?)$', re.MULTILINE)
+                    for matching_rhs in re.finditer(pattern, snippet):
+                        files = matching_rhs.group(1).split()
                         for file in files:
                             # Ignore .h files since they are not compiled.
                             if not file.endswith('.h'):