]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool.py: Make --extract-filelist match gnulib-tool.sh.
authorCollin Funk <collin.funk1@gmail.com>
Thu, 21 Mar 2024 00:51:55 +0000 (17:51 -0700)
committerBruno Haible <bruno@clisp.org>
Thu, 21 Mar 2024 15:49:06 +0000 (16:49 +0100)
* pygnulib/GLModuleSystem.py (GLModule.getFiles_Raw): New function which
returns the 'Files:' section from a module unchanged.
(GLModule.getFiles): Use it.
* pygnulib/main.py (main): Use it and match the output of gnulib-tool.sh
for --extract-filelist.

ChangeLog
pygnulib/GLModuleSystem.py
pygnulib/main.py

index e92b0cac2f01f992e13a09b77d158a1ab375e372..de653e21e87b61cbaa8ab100902be959ed1ba7d6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-03-21  Collin Funk  <collin.funk1@gmail.com>
+
+       gnulib-tool.py: Make --extract-filelist match gnulib-tool.sh.
+       * pygnulib/GLModuleSystem.py (GLModule.getFiles_Raw): New function which
+       returns the 'Files:' section from a module unchanged.
+       (GLModule.getFiles): Use it.
+       * pygnulib/main.py (main): Use it and match the output of gnulib-tool.sh
+       for --extract-filelist.
+
 2024-03-21  Bruno Haible  <bruno@clisp.org>
 
        gnulib-tool: Make the .gitignore files handling more consistent.
index a96a2988b5f785d13e426d35930ac6e7df9803ec..bec94a337425271c22b50d36ee148d5c728ead50 100644 (file)
@@ -518,13 +518,17 @@ class GLModule(object):
             self.cache['applicability'] = result
         return self.cache['applicability']
 
+    def getFiles_Raw(self) -> str:
+        '''Return the unmodified list of files as a string.'''
+        return self.sections.get('Files', '')
+
     def getFiles(self):
         '''GLModule.getFiles() -> list
 
         Return list of files.
         GLConfig: ac_version.'''
         if 'files' not in self.cache:
-            snippet = self.sections.get('Files', '')
+            snippet = self.getFiles_Raw()
             result = [ line.strip()
                        for line in snippet.split('\n')
                        if line.strip() ]
index a3e7f86387747c395af642b0aa62cd5f3a207896..eea92a925d7917b5ef096f0ef5f146503aa7bf9b 100644 (file)
@@ -1148,8 +1148,11 @@ def main():
         for name in modules:
             module = modulesystem.find(name)
             if module:
-                files = module.getFiles()
-                print(lines_to_multiline(files), end='')
+                files = module.getFiles_Raw()
+                files += 'm4/00gnulib.m4\n'
+                files += 'm4/zzgnulib.m4\n'
+                files += 'm4/gnulib-common.m4\n'
+                print(files, end='')
 
     elif mode == 'extract-dependencies':
         if avoids: