]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool.py: Make module sorting more similar to gnulib-tool.
authorCollin Funk <collin.funk1@gmail.com>
Wed, 28 Feb 2024 11:33:15 +0000 (03:33 -0800)
committerBruno Haible <bruno@clisp.org>
Wed, 28 Feb 2024 12:10:15 +0000 (13:10 +0100)
* pygnulib/GLImport.py (GLImport.__init__): Sort modules when mode is
'import'.
(GLImport.actioncmd): Don't sort modules while creating actioncmd. Use
preferred quoting style.

ChangeLog
pygnulib/GLImport.py

index 330727e02e2d2b1f258f784d3238b78b1a562cde..8cfe49894051d4def3f68830caf7df4dc9a57fc0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-02-28  Collin Funk  <collin.funk1@gmail.com>
+
+       gnulib-tool.py: Make module sorting more similar to gnulib-tool.
+       * pygnulib/GLImport.py (GLImport.__init__): Sort modules when mode is
+       'import'.
+       (GLImport.actioncmd): Don't sort modules while creating actioncmd. Use
+       preferred quoting style.
+
 2024-02-28  Bruno Haible  <bruno@clisp.org>
 
        gnulib-tool: Make --version output independent of git's configuration.
index 0f0f463add7672e138c8bace948e37c6161f3cd8..fca2333ec5693f6c41763fe718f9e5205f5e3d7a 100644 (file)
@@ -221,7 +221,9 @@ class GLImport(object):
                               for localdir in self.cache['localpath'] ]
                 self.config.setLocalPath(localpath)
 
-        if self.mode != MODES['import']:
+        if self.mode == MODES['import']:
+            self.config.setModules(sorted(self.config.getModules()))
+        else:
             if self.cache['m4base'] and (self.config['m4base'] != self.cache['m4base']):
                 raise GLError(5, m4base)
 
@@ -438,9 +440,9 @@ class GLImport(object):
         elif vc_files == False:
             actioncmd += ' \\\n#  --no-vc-files'
         if len(avoids) > 0:
-            actioncmd += ''.join([f" \\\n#  --avoid={x}" for x in sorted(avoids)])
+            actioncmd += ''.join([f' \\\n#  --avoid={x}' for x in avoids])
         if len(modules) > 0:
-            actioncmd += ''.join([f" \\\n#  {x}" for x in sorted(modules)])
+            actioncmd += ''.join([f' \\\n#  {x}' for x in modules])
         return actioncmd
 
     def relative_to_destdir(self, dir):