]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool.py: Fix a bug in removed / added files handling.
authorBruno Haible <bruno@clisp.org>
Sat, 20 Apr 2024 21:45:59 +0000 (23:45 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 20 Apr 2024 21:45:59 +0000 (23:45 +0200)
* pygnulib/GLImport.py (GLImport.execute): When looking for files that
are in both filetable['old'] and filetable['new'], consider only the
first element of each tuple, not the entire tuple.

ChangeLog
pygnulib/GLImport.py

index cd19c439df9791ea4e87f362c1e3f4f8b1dd0d72..da5c3833a28e29c38642a3fd73ea9384431d2e02 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-04-20  Bruno Haible  <bruno@clisp.org>
+
+       gnulib-tool.py: Fix a bug in removed / added files handling.
+       * pygnulib/GLImport.py (GLImport.execute): When looking for files that
+       are in both filetable['old'] and filetable['new'], consider only the
+       first element of each tuple, not the entire tuple.
+
 2024-04-20  Bruno Haible  <bruno@clisp.org>
 
        gnulib-tool.py: Sort file lists case-sensitively.
index e65e3e12352804ccf2c9ffd5ab8043b874fa6615..59c7295cbc7f2e19e1faeaec107d761067a3f0ad 100644 (file)
@@ -1048,11 +1048,18 @@ AC_DEFUN([%s_FILE_LIST], [\n''' % macro_prefix
         # Create GLFileAssistant instance to process files.
         assistant = GLFileAssistant(self.config, transformers)
 
+        # Set of rewritten-file-names from filetable['old'].
+        old_rewritten_files = { pair[0]
+                                for pair in filetable['old'] }
+        # Set of rewritten-file-names from filetable['new'].
+        new_rewritten_files = { pair[0]
+                                for pair in filetable['new'] }
+
         # Files which are in filetable['old'] and not in filetable['new'].
         # They will be removed and added to filetable['removed'] list.
-        pairs = [ f
-                  for f in filetable['old']
-                  if f not in filetable['new'] ]
+        pairs = [ pair
+                  for pair in filetable['old']
+                  if pair[0] not in new_rewritten_files ]
         pairs = sorted(set(pairs), key=lambda pair: pair[0])
         files = sorted(set(pair[0] for pair in pairs))
         for file in files:
@@ -1074,9 +1081,9 @@ AC_DEFUN([%s_FILE_LIST], [\n''' % macro_prefix
         # Files which are in filetable['new'] and not in filetable['old'].
         # They will be added/updated and added to filetable['added'] list.
         already_present = False
-        pairs = [ f
-                  for f in filetable['new']
-                  if f not in filetable['old'] ]
+        pairs = [ pair
+                  for pair in filetable['new']
+                  if pair[0] not in old_rewritten_files ]
         pairs = sorted(set(pairs))
         for pair in pairs:
             original = pair[1]
@@ -1088,9 +1095,9 @@ AC_DEFUN([%s_FILE_LIST], [\n''' % macro_prefix
         # Files which are in filetable['new'] and in filetable['old'].
         # They will be added/updated and added to filetable['added'] list.
         already_present = True
-        pairs = [ f
-                  for f in filetable['new']
-                  if f in filetable['old'] ]
+        pairs = [ pair
+                  for pair in filetable['new']
+                  if pair[0] in old_rewritten_files ]
         pairs = sorted(set(pairs))
         for pair in pairs:
             original = pair[1]