From e8af5902305911b4b7fda933347422b3b12e84ec Mon Sep 17 00:00:00 2001 From: Collin Funk Date: Wed, 20 Mar 2024 17:51:55 -0700 Subject: [PATCH] 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. --- ChangeLog | 9 +++++++++ pygnulib/GLModuleSystem.py | 6 +++++- pygnulib/main.py | 7 +++++-- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e92b0cac2f..de653e21e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2024-03-21 Collin Funk + + 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 gnulib-tool: Make the .gitignore files handling more consistent. diff --git a/pygnulib/GLModuleSystem.py b/pygnulib/GLModuleSystem.py index a96a2988b5..bec94a3374 100644 --- a/pygnulib/GLModuleSystem.py +++ b/pygnulib/GLModuleSystem.py @@ -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() ] diff --git a/pygnulib/main.py b/pygnulib/main.py index a3e7f86387..eea92a925d 100644 --- a/pygnulib/main.py +++ b/pygnulib/main.py @@ -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: -- 2.39.5