]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool: Fix test failures (regression 2024-12-06).
authorBruno Haible <bruno@clisp.org>
Mon, 9 Dec 2024 11:30:23 +0000 (12:30 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 9 Dec 2024 11:30:23 +0000 (12:30 +0100)
* gnulib-tool.sh (func_import): Try both remove-potcdate.sin and
remove-potcdate.sed, whichever exists.
* pygnulib/GLImport.py (GLImport.execute): Likewise.

ChangeLog
gnulib-tool.sh
pygnulib/GLImport.py

index 52a781f58edd2f4721d527e80cb276345a675d03..cfe2d3d18e986c98f1ea406f3ec4ca469528fa35 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-12-09  Bruno Haible  <bruno@clisp.org>
+
+       gnulib-tool: Fix test failures (regression 2024-12-06).
+       * gnulib-tool.sh (func_import): Try both remove-potcdate.sin and
+       remove-potcdate.sed, whichever exists.
+       * pygnulib/GLImport.py (GLImport.execute): Likewise.
+
 2024-12-09  Paul Eggert  <eggert@cs.ucla.edu>
 
        gnupload: mention GPG_TTY
index dccea21ce85fc7ab8cd051ce3d154835f9dcd48f..c29de46b8f9704727286d827cd0839ffb23cd733 100755 (executable)
@@ -5799,32 +5799,34 @@ s,//*$,/,'
   # Create po/ directory.
   if test -n "$pobase"; then
     # Create po makefile and auxiliary files.
-    for file in Makefile.in.in remove-potcdate.sed; do
+    for file in Makefile.in.in remove-potcdate.sin remove-potcdate.sed; do
       func_dest_tmpfilename $pobase/$file
-      func_lookup_file build-aux/po/$file
-      cat "$lookedup_file" > "$tmpfile"
-      if test -f "$destdir"/$pobase/$file; then
-        if cmp -s "$destdir"/$pobase/$file "$tmpfile"; then
-          rm -f "$tmpfile"
+      if test -r "$gnulib_dir/build-aux/po/$file"; then
+        func_lookup_file build-aux/po/$file
+        cat "$lookedup_file" > "$tmpfile"
+        if test -f "$destdir"/$pobase/$file; then
+          if cmp -s "$destdir"/$pobase/$file "$tmpfile"; then
+            rm -f "$tmpfile"
+          else
+            if $doit; then
+              echo "Updating $pobase/$file (backup in $pobase/$file~)"
+              mv -f "$destdir"/$pobase/$file "$destdir"/$pobase/$file~
+              mv -f "$tmpfile" "$destdir"/$pobase/$file
+            else
+              echo "Update $pobase/$file (backup in $pobase/$file~)"
+              rm -f "$tmpfile"
+            fi
+          fi
         else
           if $doit; then
-            echo "Updating $pobase/$file (backup in $pobase/$file~)"
-            mv -f "$destdir"/$pobase/$file "$destdir"/$pobase/$file~
+            echo "Creating $pobase/$file"
             mv -f "$tmpfile" "$destdir"/$pobase/$file
           else
-            echo "Update $pobase/$file (backup in $pobase/$file~)"
+            echo "Create $pobase/$file"
             rm -f "$tmpfile"
           fi
+          func_append added_files "$pobase/$file$nl"
         fi
-      else
-        if $doit; then
-          echo "Creating $pobase/$file"
-          mv -f "$tmpfile" "$destdir"/$pobase/$file
-        else
-          echo "Create $pobase/$file"
-          rm -f "$tmpfile"
-        fi
-        func_append added_files "$pobase/$file$nl"
       fi
     done
     # Create po makefile parameterization, part 1.
index 7747761900bb1882d061f9f2376c345a2c3bdcb6..609f8cc827a6e41049091c10fadb900fb9560695 100644 (file)
@@ -1081,26 +1081,27 @@ AC_DEFUN([%s_FILE_LIST], [\n''' % macro_prefix
         filesystem = GLFileSystem(self.config)
         if pobase:
             # Create po makefile and auxiliary files.
-            for file in ['Makefile.in.in', 'remove-potcdate.sed']:
+            for file in ['Makefile.in.in', 'remove-potcdate.sin', 'remove-potcdate.sed']:
                 tmpfile = assistant.tmpfilename(joinpath(pobase, file))
                 path = joinpath('build-aux', 'po', file)
-                lookedup, flag = filesystem.lookup(path)
-                copyfile(lookedup, tmpfile)
-                basename = joinpath(pobase, file)
-                filename, backup, flag = assistant.super_update(basename, tmpfile)
-                if flag == 1:
-                    if not self.config['dryrun']:
-                        print('Updating %s (backup in %s)' % (filename, backup))
-                    else:  # if self.config['dryrun']
-                        print('Update %s (backup in %s)' % (filename, backup))
-                elif flag == 2:
-                    if not self.config['dryrun']:
-                        print('Creating %s' % filename)
-                    else:  # if self.config['dryrun']:
-                        print('Create %s' % filename)
-                    filetable.added_files.append(filename)
-                if os.path.isfile(tmpfile):
-                    os.remove(tmpfile)
+                if os.path.exists(joinpath(DIRS['root'], path)):
+                    lookedup, flag = filesystem.lookup(path)
+                    copyfile(lookedup, tmpfile)
+                    basename = joinpath(pobase, file)
+                    filename, backup, flag = assistant.super_update(basename, tmpfile)
+                    if flag == 1:
+                        if not self.config['dryrun']:
+                            print('Updating %s (backup in %s)' % (filename, backup))
+                        else:  # if self.config['dryrun']
+                            print('Update %s (backup in %s)' % (filename, backup))
+                    elif flag == 2:
+                        if not self.config['dryrun']:
+                            print('Creating %s' % filename)
+                        else:  # if self.config['dryrun']:
+                            print('Create %s' % filename)
+                        filetable.added_files.append(filename)
+                    if os.path.isfile(tmpfile):
+                        os.remove(tmpfile)
 
             # Create po makefile parameterization, part 1.
             basename = joinpath(pobase, 'Makevars')