Hi Bruno,

When looking at your bug report I noticed a few lines of the diff are
just different orderings.

Running:

    GNULIB_TOOL_IMPL=sh+py ./gnulib-tool --create-megatestdir --dir=testdir2 
--single-configure sys_types stdio

We see in the diff:

diff -ru testdir2/Makefile.am testdir2-glpy85706/Makefile.am
--- testdir2/Makefile.am        2024-04-27 13:53:51.443692945 -0700
+++ testdir2-glpy85706/Makefile.am      2024-04-27 13:53:33.063660555 -0700
@@ -2,6 +2,6 @@
 
 AUTOMAKE_OPTIONS = 1.14 foreign
 
-SUBDIRS = sys_types stdio ALL
+SUBDIRS = stdio sys_types ALL

This can also be seen in configure.ac and the generated configure
script. The behavior of gnulib-tool.py is to sort the modules and
gnulib-tool.sh uses them as passed.

I feel like the best solution here is just to sort the modules in
gnulib-tool.sh. Since gnulib-tool.py turns the strings into a set of
GLModules and then sorts them.

Can I apply the attached patch? Asking since I feel less comfortable
making changes outside of pygnulib/* and I'm not sure if/how to apply
them to stable branches.

Collin
From c6877b8f0fcd34a96f8874199eafae14b3241d77 Mon Sep 17 00:00:00 2001
From: Collin Funk <collin.fu...@gmail.com>
Date: Sat, 27 Apr 2024 14:03:27 -0700
Subject: [PATCH] gnulib-tool.sh: Match sorting of gnulib-tool.py in output.

* gnulib-tool.sh (func_create_megatestdir): Sort the modules so
AC_CONFIG_SUBDIRS in configure.ac and SUBDIRS in Makefile.am are also
sorted.
---
 ChangeLog      | 7 +++++++
 gnulib-tool.sh | 1 +
 2 files changed, 8 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 935ddbd1ba..61518a200e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-04-27  Collin Funk  <collin.fu...@gmail.com>
+
+	gnulib-tool.sh: Match sorting of gnulib-tool.py in output.
+	* gnulib-tool.sh (func_create_megatestdir): Sort the modules so
+	AC_CONFIG_SUBDIRS in configure.ac and SUBDIRS in Makefile.am are also
+	sorted.
+
 2024-04-27  Bruno Haible  <br...@clisp.org>
 
 	fcntl-h, stdio, unistd: Ensure off64_t is defined on all platforms.
diff --git a/gnulib-tool.sh b/gnulib-tool.sh
index b486e99b1e..13a9bdf535 100755
--- a/gnulib-tool.sh
+++ b/gnulib-tool.sh
@@ -7135,6 +7135,7 @@ func_create_megatestdir ()
   if test -z "$allmodules"; then
     allmodules=`func_all_modules`
   fi
+  allmodules=`for module in $allmodules; do echo $module; done | sort -u`
 
   megasubdirs=
   # First, all modules one by one.
-- 
2.44.0

Reply via email to