On 3/31/24 5:32 PM, Collin Funk wrote:
> The top part seems like a sorting issue maybe?

This patch fixes this issue.

I was a bit suspicious of this sorted() call previously, but left it
because I had no proof it was incorrect.

diff --git a/pygnulib/GLImport.py b/pygnulib/GLImport.py
index 294a8df979..0adfd8a73c 100644
--- a/pygnulib/GLImport.py
+++ b/pygnulib/GLImport.py
@@ -942,7 +942,7 @@ AC_DEFUN([%s_FILE_LIST], [\n''' % macro_prefix
         # Determine the final file lists.
         main_filelist, tests_filelist = \
             self.moduletable.filelist_separately(main_modules, tests_modules)
-        filelist = sorted(set(main_filelist + tests_filelist), key=str.lower)
+        filelist = sorted(set(main_filelist + tests_filelist))
         if not filelist:
             raise GLError(12, None)

This seems to match gnulib-tool.sh line 3562:

     files=`{ echo "$main_files"; echo "$testsrelated_files"; } | sed -e 
"$sed_remove_empty_lines" | LC_ALL=C sort -u`

It seems like there are only a few cases where case-insensitive
sorting would matter, so that is why I only noticed now.

Collin
From 025c3a6a61234b29aa172eb096c24affefe3f384 Mon Sep 17 00:00:00 2001
From: Collin Funk <collin.fu...@gmail.com>
Date: Sun, 31 Mar 2024 18:00:16 -0700
Subject: [PATCH] gnulib-tool.py: Use case-sensitive sorting for files.

* pygnulib/GLImport.py (GLImport.prepare): Remove the str.lower key from
the call to sorted().
---
 ChangeLog            | 6 ++++++
 pygnulib/GLImport.py | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 6a2b024832..5381e276c6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-03-31  Collin Funk  <collin.fu...@gmail.com>
+
+	gnulib-tool.py: Use case-sensitive sorting for files.
+	* pygnulib/GLImport.py (GLImport.prepare): Remove the str.lower key from
+	the call to sorted().
+
 2024-03-31  Collin Funk  <collin.fu...@gmail.com>
 
 	gnulib-tool.py: Add missing quotation mark to reminder.
diff --git a/pygnulib/GLImport.py b/pygnulib/GLImport.py
index 294a8df979..0adfd8a73c 100644
--- a/pygnulib/GLImport.py
+++ b/pygnulib/GLImport.py
@@ -942,7 +942,7 @@ AC_DEFUN([%s_FILE_LIST], [\n''' % macro_prefix
         # Determine the final file lists.
         main_filelist, tests_filelist = \
             self.moduletable.filelist_separately(main_modules, tests_modules)
-        filelist = sorted(set(main_filelist + tests_filelist), key=str.lower)
+        filelist = sorted(set(main_filelist + tests_filelist))
         if not filelist:
             raise GLError(12, None)
 
-- 
2.44.0

Reply via email to