From: Bruno Haible Date: Mon, 9 Dec 2024 11:30:23 +0000 (+0100) Subject: gnulib-tool: Fix test failures (regression 2024-12-06). X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=f554058cdbe6877168298eb848085d0e5d9fbe62;p=gnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index 52a781f58e..cfe2d3d18e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2024-12-09 Bruno Haible + + 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 gnupload: mention GPG_TTY diff --git a/gnulib-tool.sh b/gnulib-tool.sh index dccea21ce8..c29de46b8f 100755 --- a/gnulib-tool.sh +++ b/gnulib-tool.sh @@ -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. diff --git a/pygnulib/GLImport.py b/pygnulib/GLImport.py index 7747761900..609f8cc827 100644 --- a/pygnulib/GLImport.py +++ b/pygnulib/GLImport.py @@ -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')