bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnulib-tool --extract-filelist whitespace diff fix


From: Collin Funk
Subject: gnulib-tool --extract-filelist whitespace diff fix
Date: Tue, 19 Mar 2024 21:01:19 -0700
User-agent: Mozilla Thunderbird

When looking at the gnulib-tool test suite I noticed that the
'--extract-filelist' tests fail because of this whitespace difference:

$ env GNULIB_TOOL_IMPL=sh gnulib-tool --extract-filelist warnings
m4/warnings.m4

m4/00gnulib.m4
m4/zzgnulib.m4
m4/gnulib-common.m4

$ env GNULIB_TOOL_IMPL=py gnulib-tool --extract-filelist warnings
m4/warnings.m4
m4/00gnulib.m4
m4/zzgnulib.m4
m4/gnulib-common.m4

Forgive me if this is a silly question, but are 'm4/00gnulib.m4',
'm4/zzgnulib.m4', 'm4/gnulib-common.m4' implied for every module? Even
if it has no sources?

I am hesitant to change the GLModule.getFiles() function to include an
empty string just so that joining the lines emits an empty line.

This solution should work. It is not very pretty, but doesn't risk
breaking code that makes assumptions about the return value of
GLModule.getFiles().

diff --git a/pygnulib/main.py b/pygnulib/main.py
index a3e7f86387..56ba75584d 100644
--- a/pygnulib/main.py
+++ b/pygnulib/main.py
@@ -1149,6 +1149,8 @@ def main():
             module = modulesystem.find(name)
             if module:
                 files = module.getFiles()
+                if len(files) > 3:
+                   files = files[:-3] + [''] + files[-3:]
                 print(lines_to_multiline(files), end='')

Collin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]