+2024-04-20 Bruno Haible <bruno@clisp.org>
+
+ gnulib-tool: In sh+py mode, don't fail because of dangling symlinks.
+ Reported by Paul Eggert in
+ <https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00318.html>
+ and Pádraig Brady in
+ <https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00321.html>.
+ * gnulib-tool: In sh+py mode, use diff option '--no-dereference' if
+ available.
+
2024-04-20 Collin Funk <collin.funk1@gmail.com>
gnulib-tool.py: Remove duplicate per-module definitions.
func_fatal_error "gnulib-tool.sh succeeded but gnulib-tool.py failed! Inspect $tmp/ and $tmp-py-err."
fi
# Compare the two results on the file system.
- diff -r -q . "$tmp" >/dev/null ||
+ # GNU diffutils 3.3 or newer support option --no-dereference. This
+ # option avoids errors on dangling links.
+ if LC_ALL=C diff --help 2>/dev/null | grep no-dereference >/dev/null; then
+ diff_options='--no-dereference'
+ else
+ diff_options=
+ fi
+ diff -r $diff_options -q . "$tmp" >/dev/null ||
func_fatal_error "gnulib-tool.py produced different files than gnulib-tool.sh! Compare `pwd` and $tmp."
# Compare the two outputs.
diff -q "$tmp-sh-out" "$tmp-py-out" >/dev/null ||
func_fatal_error "gnulib-tool.sh succeeded but gnulib-tool.py failed! Inspect $tmp/ and $tmp-py-err."
fi
# Compare the two results on the file system.
- diff -r -q "$dir" "$tmp" >/dev/null ||
+ # GNU diffutils 3.3 or newer support option --no-dereference. This
+ # option avoids errors on dangling links.
+ if LC_ALL=C diff --help 2>/dev/null | grep no-dereference >/dev/null; then
+ diff_options='--no-dereference'
+ else
+ diff_options=
+ fi
+ diff -r $diff_options -q "$dir" "$tmp" >/dev/null ||
func_fatal_error "gnulib-tool.py produced different files than gnulib-tool.sh! Compare $dir and $tmp."
# Compare the two outputs.
diff -q "$tmp-sh-out" "$tmp-py-out" >/dev/null ||