When testing the last patch I noticed that gnulib-tool and
gnulib-tool.py output file lists assigned to Make variables in a
different order. Here is an example:

$ gnulib-tool --create-testdir --dir test-shell fts
$ gnulib-tool.py --create-testdir --dir test-python fts
$ git diff --no-index test-python/gltests/Makefile.am 
test-shell/gltests/Makefile.am

Gives lots of lines like this:

-EXTRA_DIST += macros.h signature.h test-ftruncate.c test-ftruncate.sh
+EXTRA_DIST += test-ftruncate.c test-ftruncate.sh signature.h macros.h

It seems that the Python version sorts the files in
GLModule.getAutomakeSnippet_Unconditional and the shell script doesn't
in func_get_automake_snippet_unconditional.

Either one of the diff's below should fix the discrepancy. I'm not
sure which one would be preferred though. I feel like the sorting
shouldn't take much time, but it might be worth saving gnulib-tool the
work. :)

Same but unsorted:
diff --git a/pygnulib/GLModuleSystem.py b/pygnulib/GLModuleSystem.py
index 3672474fa1..86794cf80e 100644
--- a/pygnulib/GLModuleSystem.py
+++ b/pygnulib/GLModuleSystem.py
@@ -571,7 +571,6 @@ class GLModule(object):
                 files = self.getFiles()
                 extra_files = filter_filelist(constants.NL, files,
                                               'tests/', '', 'tests/', 
'').split(constants.NL)
-                extra_files = sorted(set(extra_files))
                 if extra_files:
                     result += 'EXTRA_DIST += %s' % ' '.join(extra_files)
                     result += constants.NL * 2

or

Same but sorted:
diff --git a/gnulib-tool b/gnulib-tool
index a7ba7a98f1..a1252fc709 100755
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -2561,7 +2561,7 @@ func_get_automake_snippet_unconditional ()
       # Synthesize an EXTRA_DIST augmentation.
       all_files=`func_get_filelist $1`
       func_filter_filelist tests_files " " "$all_files" 'tests/' '' 'tests/' ''
-      extra_files="$tests_files"
+      extra_files="`for f in $tests_files; do echo $f; done | LC_ALL=C sort 
-u`"
       if test -n "$extra_files"; then
         echo "EXTRA_DIST +=" $extra_files
         echo


Collin

Reply via email to