]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool.py: Fix exception during --update with changed macro-prefix.
authorBruno Haible <bruno@clisp.org>
Tue, 15 Apr 2025 20:21:04 +0000 (22:21 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 15 Apr 2025 20:21:04 +0000 (22:21 +0200)
* pygnulib/GLImport.py (GLImport.__init__): Support the case that the
expected ${macro_prefix}_FILE_LIST definition was not found.

ChangeLog
pygnulib/GLImport.py

index e07f4b01cadd6423d0359a5b8f7e417d86857626..7d255be3a2d00e51bced063f6aded595d75f6ed7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-04-15  Bruno Haible  <bruno@clisp.org>
+
+       gnulib-tool.py: Fix exception during --update with changed macro-prefix.
+       * pygnulib/GLImport.py (GLImport.__init__): Support the case that the
+       expected ${macro_prefix}_FILE_LIST definition was not found.
+
 2025-04-15  Bruno Haible  <bruno@clisp.org>
 
        trim tests: Avoid test failures on macOS 15.4.
index 27d8b749edc1ac708da105c8d8e5c43af75b19d9..9344c8fa9d1092a57e6d670394ae152eff3636dd 100644 (file)
@@ -231,7 +231,12 @@ class GLImport:
                     data = file.read()
                 regex = r'AC_DEFUN\(\[%s_FILE_LIST\], \[(.*?)\]\)' % self.cache['macro_prefix']
                 pattern = re.compile(regex, re.S | re.M)
-                self.cache.setFiles(pattern.findall(data)[-1].strip().split())
+                matches = pattern.findall(data)
+                if matches:
+                    files = matches[-1].strip().split()
+                else:
+                    files = []
+                self.cache.setFiles(files)
 
         # The self.config['localpath'] defaults to the cached one. Recall that
         # the cached one is relative to self.config['destdir'], whereas the one