[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Gavin D. Smith |
Date: |
Tue, 20 Aug 2024 15:47:50 -0400 (EDT) |
branch: release/7.1
commit 7cdcd1f19684cea479c2a3872ded8aa228d3476e
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Sun Aug 18 16:44:19 2024 +0100
Check for diff --strip-trailing-cr.
* configure.ac (DIFF_OPTIONS, DIFF_U_OPTION, DIFF_A_OPTION):
Do not AC_SUBST DIFF_U_OPTION or DIFF_A_OPTION, using DIFF_OPTIONS
instead.
(DIFF_CR_OPTION) [mingw]: Check if --strip-trailing-cr option
works and include it in DIFF_OPTIONS if so.
* tp/tests/run_parser_all.sh,
* tp/defs.in,
* tp/tests/many_input_files/different_encodings.sh,
* tp/tests/many_input_files/different_languages_gen_master_menu.sh,
* tp/tests/many_input_files/input_dir_non_ascii.sh,
* tp/tests/many_input_files/output_dir_file_non_ascii.sh,
* tp/tests/many_input_files/output_dir_non_ascii.sh,
* tp/tests/many_input_files/tex_l2h.sh,
* tp/tests/many_input_files/tex_l2h_output_dir_non_ascii.sh,
* tp/tests/many_input_files/tex_t4ht.sh,
* tp/tests/many_input_files/tex_t4ht_output_dir_non_ascii.sh,
* Pod-Simple-Texinfo/test_scripts/manual_sectioning_gap_test.sh,
* Pod-Simple-Texinfo/test_scripts/test_empty_head2.sh,
* Pod-Simple-Texinfo/test_scripts/test_ref_to_unknown.sh:
Use DIFF_OPTIONS instead of DIFF_A_OPTION and/or DIFF_U_OPTION
in order to have --strip-trailing-cr possibly included.
* install-info/defs.in: Remove handling of --strip-trailing-cr,
using DIFF_OPTIONS instead.
Test failures due to carriage returns on mingw reported by
Bruno Haible, bug-texinfo 2024-06-09.
---
ChangeLog | 30 ++++++++++++++++++++++
configure.ac | 24 +++++++++++++++--
install-info/tests/defs.in | 5 +---
tp/defs.in | 3 +--
tp/tests/many_input_files/different_encodings.sh | 2 +-
.../different_languages_gen_master_menu.sh | 2 +-
tp/tests/many_input_files/input_dir_non_ascii.sh | 2 +-
.../many_input_files/output_dir_file_non_ascii.sh | 2 +-
tp/tests/many_input_files/output_dir_non_ascii.sh | 2 +-
tp/tests/many_input_files/tex_l2h.sh | 2 +-
.../tex_l2h_output_dir_non_ascii.sh | 2 +-
tp/tests/many_input_files/tex_t4ht.sh | 2 +-
.../tex_t4ht_output_dir_non_ascii.sh | 2 +-
tp/tests/run_parser_all.sh | 2 +-
14 files changed, 64 insertions(+), 18 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 01d854fdba..ad469bb6ff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,33 @@
+2024-08-20 Gavin Smith <gavinsmith0123@gmail.com>
+
+ Check for diff --strip-trailing-cr.
+
+ * configure.ac (DIFF_OPTIONS, DIFF_U_OPTION, DIFF_A_OPTION):
+ Do not AC_SUBST DIFF_U_OPTION or DIFF_A_OPTION, using DIFF_OPTIONS
+ instead.
+ (DIFF_CR_OPTION) [mingw]: Check if --strip-trailing-cr option
+ works and include it in DIFF_OPTIONS if so.
+
+ * tp/tests/run_parser_all.sh,
+ * tp/defs.in,
+ * tp/tests/many_input_files/different_encodings.sh,
+ * tp/tests/many_input_files/different_languages_gen_master_menu.sh,
+ * tp/tests/many_input_files/input_dir_non_ascii.sh,
+ * tp/tests/many_input_files/output_dir_file_non_ascii.sh,
+ * tp/tests/many_input_files/output_dir_non_ascii.sh,
+ * tp/tests/many_input_files/tex_l2h.sh,
+ * tp/tests/many_input_files/tex_l2h_output_dir_non_ascii.sh,
+ * tp/tests/many_input_files/tex_t4ht.sh,
+ * tp/tests/many_input_files/tex_t4ht_output_dir_non_ascii.sh,
+ Use DIFF_OPTIONS instead of DIFF_A_OPTION and/or DIFF_U_OPTION
+ in order to have --strip-trailing-cr possibly included.
+
+ * install-info/defs.in: Remove handling of --strip-trailing-cr,
+ using DIFF_OPTIONS instead.
+
+ Test failures due to carriage returns on mingw reported by
+ Bruno Haible, bug-texinfo 2024-06-09.
+
2024-07-20 Andreas Schwab <schwab@linux-m68k.org>
* info/variables.c (set_variable_to_value): Add end marker to
diff --git a/configure.ac b/configure.ac
index 47465b7cf1..62edfbe922 100644
--- a/configure.ac
+++ b/configure.ac
@@ -197,7 +197,6 @@ DIFF_U_OPTION=
if test "z$diff_accepts_u_option" = 'zyes' ; then
DIFF_U_OPTION=-u
fi
-AC_SUBST([DIFF_U_OPTION])
# check whether diff accepts the -a option (only needed for GNU diff).
AC_MSG_CHECKING(whether diff accepts -a)
@@ -215,7 +214,28 @@ DIFF_A_OPTION=
if test "z$diff_accepts_a_option" = 'zyes' ; then
DIFF_A_OPTION=-a
fi
-AC_SUBST([DIFF_A_OPTION])
+
+# check whether diff should have --strip-trailing-cr (may be needed on MinGW)
+diff_accepts_cr_option=no
+if echo $host_os | grep mingw >/dev/null ; then
+ AC_MSG_CHECKING(whether diff accepts --strip-trailing-cr)
+ echo foo >conftest.dtx
+ echo foo | diff --strip-trailing-cr - conftest.dtx >/dev/null 2>&1
+ error_status_diff_cr=$?
+ if test $error_status_diff_cr = 0; then
+ diff_accepts_cr_option=yes
+ fi
+ AC_MSG_RESULT($diff_accepts_cr_option)
+ rm -f conftest.dtx
+fi
+
+DIFF_CR_OPTION=
+if test "z$diff_accepts_cr_option" = 'zyes' ; then
+ DIFF_CR_OPTION='--strip-trailing-cr'
+fi
+
+DIFF_OPTIONS="$DIFF_A_OPTION $DIFF_U_OPTION $DIFF_CR_OPTION"
+AC_SUBST([DIFF_OPTIONS])
# Checks for header files.
AC_CHECK_HEADERS(io.h pwd.h \
diff --git a/install-info/tests/defs.in b/install-info/tests/defs.in
index 71e0e2628f..c0d3182545 100644
--- a/install-info/tests/defs.in
+++ b/install-info/tests/defs.in
@@ -72,10 +72,7 @@ else
path_sep=":"
fi
-diff=diff
-if echo '@host_os@' | $EGREP 'mingw' >/dev/null; then
- diff='diff --strip-trailing-cr'
-fi
+diff="diff @DIFF_OPTIONS@"
# Return true if PROG is somewhere in PATH, else false.
findprog ()
diff --git a/tp/defs.in b/tp/defs.in
index 51b0202667..d620b23082 100644
--- a/tp/defs.in
+++ b/tp/defs.in
@@ -1,6 +1,5 @@
PERL="@PERL@"
-DIFF_U_OPTION="@DIFF_U_OPTION@"
-DIFF_A_OPTION="@DIFF_A_OPTION@"
+DIFF_OPTIONS="@DIFF_OPTIONS@"
HOST_IS_WINDOWS_VARIABLE="@HOST_IS_WINDOWS_VARIABLE@"
PERL_UNICODE_COLLATE_OK="@PERL_UNICODE_COLLATE_OK@"
if [ "z$srcdir" = 'z' ]; then
diff --git a/tp/tests/many_input_files/different_encodings.sh
b/tp/tests/many_input_files/different_encodings.sh
index 52e9fbd72b..20aad5cb47 100755
--- a/tp/tests/many_input_files/different_encodings.sh
+++ b/tp/tests/many_input_files/different_encodings.sh
@@ -61,7 +61,7 @@ else
rm -rf $staging_dir/${dir}_res
cp -pr "$srcdir/${dir}_res" $staging_dir
chmod -R u+w "$staging_dir/${dir}_res"
- diff $DIFF_U_OPTION -r "$staging_dir/${dir}_res" "$outdir" 2>>$logfile >
"$diffs_dir/$dir.diff"
+ diff $DIFF_OPTIONS -r "$staging_dir/${dir}_res" "$outdir" 2>>$logfile >
"$diffs_dir/$dir.diff"
dif_ret=$?
if [ $dif_ret != 0 ]; then
echo "D: $diffs_dir/$dir.diff"
diff --git a/tp/tests/many_input_files/different_languages_gen_master_menu.sh
b/tp/tests/many_input_files/different_languages_gen_master_menu.sh
index a46e7377bd..5d751f99ad 100755
--- a/tp/tests/many_input_files/different_languages_gen_master_menu.sh
+++ b/tp/tests/many_input_files/different_languages_gen_master_menu.sh
@@ -55,7 +55,7 @@ else
rm -rf $staging_dir/${dir}_res
cp -pr "$srcdir/${dir}_res" $staging_dir
chmod -R u+w "$staging_dir/${dir}_res"
- diff $DIFF_U_OPTION -r "$staging_dir/${dir}_res" "$outdir" 2>>$logfile >
"$diffs_dir/$dir.diff"
+ diff $DIFF_OPTIONS -r "$staging_dir/${dir}_res" "$outdir" 2>>$logfile >
"$diffs_dir/$dir.diff"
dif_ret=$?
if [ $dif_ret != 0 ]; then
echo "D: $diffs_dir/$dir.diff"
diff --git a/tp/tests/many_input_files/input_dir_non_ascii.sh
b/tp/tests/many_input_files/input_dir_non_ascii.sh
index 42e3dec3ef..13bb643ce2 100755
--- a/tp/tests/many_input_files/input_dir_non_ascii.sh
+++ b/tp/tests/many_input_files/input_dir_non_ascii.sh
@@ -62,7 +62,7 @@ else
rm -rf $staging_dir/${dir}_res
cp -pr "$srcdir/${dir}_res" $staging_dir
chmod -R u+w "$staging_dir/${dir}_res"
- diff $DIFF_U_OPTION -r "$staging_dir/${dir}_res" "$outdir" 2>>$logfile >
"$diffs_dir/$dir.diff"
+ diff $DIFF_OPTIONS -r "$staging_dir/${dir}_res" "$outdir" 2>>$logfile >
"$diffs_dir/$dir.diff"
dif_ret=$?
if [ $dif_ret != 0 ]; then
echo "D: $diffs_dir/$dir.diff"
diff --git a/tp/tests/many_input_files/output_dir_file_non_ascii.sh
b/tp/tests/many_input_files/output_dir_file_non_ascii.sh
index 0c7d45d85f..4bc023da74 100755
--- a/tp/tests/many_input_files/output_dir_file_non_ascii.sh
+++ b/tp/tests/many_input_files/output_dir_file_non_ascii.sh
@@ -64,7 +64,7 @@ else
rm -rf $staging_dir/${dir}_res
cp -pr "$srcdir/${dir}_res" $staging_dir
chmod -R u+w "$staging_dir/${dir}_res"
- diff $DIFF_U_OPTION -r "$staging_dir/${dir}_res" "$outdir" 2>>$logfile >
"$diffs_dir/$dir.diff"
+ diff $DIFF_OPTIONS -r "$staging_dir/${dir}_res" "$outdir" 2>>$logfile >
"$diffs_dir/$dir.diff"
dif_ret=$?
if [ $dif_ret != 0 ]; then
echo "D: $diffs_dir/$dir.diff"
diff --git a/tp/tests/many_input_files/output_dir_non_ascii.sh
b/tp/tests/many_input_files/output_dir_non_ascii.sh
index 3ce85ee480..e9f042c65d 100755
--- a/tp/tests/many_input_files/output_dir_non_ascii.sh
+++ b/tp/tests/many_input_files/output_dir_non_ascii.sh
@@ -64,7 +64,7 @@ else
rm -rf $staging_dir/${dir}_res
cp -pr "$srcdir/${dir}_res" $staging_dir
chmod -R u+w "$staging_dir/${dir}_res"
- diff $DIFF_U_OPTION -r "$staging_dir/${dir}_res" "$outdir" 2>>$logfile >
"$diffs_dir/$dir.diff"
+ diff $DIFF_OPTIONS -r "$staging_dir/${dir}_res" "$outdir" 2>>$logfile >
"$diffs_dir/$dir.diff"
dif_ret=$?
if [ $dif_ret != 0 ]; then
echo "D: $diffs_dir/$dir.diff"
diff --git a/tp/tests/many_input_files/tex_l2h.sh
b/tp/tests/many_input_files/tex_l2h.sh
index cff9b25ad1..09f3750f65 100755
--- a/tp/tests/many_input_files/tex_l2h.sh
+++ b/tp/tests/many_input_files/tex_l2h.sh
@@ -92,7 +92,7 @@ else
rm -rf $staging_dir/${dir}_res
cp -pr "$srcdir/${dir}_res" $staging_dir
chmod -R u+w "$staging_dir/${dir}_res"
- diff $DIFF_U_OPTION -r "$staging_dir/${dir}_res" "$outdir" 2>>$logfile >
"$diffs_dir/$dir.diff"
+ diff $DIFF_OPTIONS -r "$staging_dir/${dir}_res" "$outdir" 2>>$logfile >
"$diffs_dir/$dir.diff"
dif_ret=$?
if [ $dif_ret != 0 ]; then
echo "D: $diffs_dir/$dir.diff"
diff --git a/tp/tests/many_input_files/tex_l2h_output_dir_non_ascii.sh
b/tp/tests/many_input_files/tex_l2h_output_dir_non_ascii.sh
index 45b91ddb91..ddbdbefedb 100755
--- a/tp/tests/many_input_files/tex_l2h_output_dir_non_ascii.sh
+++ b/tp/tests/many_input_files/tex_l2h_output_dir_non_ascii.sh
@@ -101,7 +101,7 @@ else
rm -rf $staging_dir/${dir}_res
cp -pr "$srcdir/${dir}_res" $staging_dir
chmod -R u+w "$staging_dir/${dir}_res"
- diff $DIFF_U_OPTION -r "$staging_dir/${dir}_res" "$outdir" 2>>$logfile >
"$diffs_dir/$dir.diff"
+ diff $DIFF_OPTIONS -r "$staging_dir/${dir}_res" "$outdir" 2>>$logfile >
"$diffs_dir/$dir.diff"
dif_ret=$?
if [ $dif_ret != 0 ]; then
echo "D: $diffs_dir/$dir.diff"
diff --git a/tp/tests/many_input_files/tex_t4ht.sh
b/tp/tests/many_input_files/tex_t4ht.sh
index 21897bd6dd..9d5f89257f 100755
--- a/tp/tests/many_input_files/tex_t4ht.sh
+++ b/tp/tests/many_input_files/tex_t4ht.sh
@@ -57,7 +57,7 @@ else
rm -rf $staging_dir/${dir}_res
cp -pr "$srcdir/${dir}_res" $staging_dir
chmod -R u+w "$staging_dir/${dir}_res"
- diff $DIFF_U_OPTION -r "$staging_dir/${dir}_res" "${outdir}" 2>>$logfile >
"$diffs_dir/$dir.diff"
+ diff $DIFF_OPTIONS -r "$staging_dir/${dir}_res" "${outdir}" 2>>$logfile >
"$diffs_dir/$dir.diff"
dif_ret=$?
if [ $dif_ret != 0 ]; then
echo "D: $diffs_dir/$dir.diff"
diff --git a/tp/tests/many_input_files/tex_t4ht_output_dir_non_ascii.sh
b/tp/tests/many_input_files/tex_t4ht_output_dir_non_ascii.sh
index e272176990..d94850af30 100755
--- a/tp/tests/many_input_files/tex_t4ht_output_dir_non_ascii.sh
+++ b/tp/tests/many_input_files/tex_t4ht_output_dir_non_ascii.sh
@@ -67,7 +67,7 @@ else
rm -rf $staging_dir/${dir}_res
cp -pr "$srcdir/${dir}_res" $staging_dir
chmod -R u+w "$staging_dir/${dir}_res"
- diff $DIFF_U_OPTION -r "$staging_dir/${dir}_res" "${outdir}" 2>>$logfile >
"$diffs_dir/$dir.diff"
+ diff $DIFF_OPTIONS -r "$staging_dir/${dir}_res" "${outdir}" 2>>$logfile >
"$diffs_dir/$dir.diff"
dif_ret=$?
if [ $dif_ret != 0 ]; then
echo "D: $diffs_dir/$dir.diff"
diff --git a/tp/tests/run_parser_all.sh b/tp/tests/run_parser_all.sh
index d7061562b6..9b26fc02c3 100755
--- a/tp/tests/run_parser_all.sh
+++ b/tp/tests/run_parser_all.sh
@@ -434,7 +434,7 @@ while read line; do
post_process_output
if test "z$res_dir_used" != 'z' ; then
- diff $DIFF_A_OPTION $DIFF_U_OPTION -r "$res_dir_used" "${outdir}$dir"
2>>$logfile > "$testdir/$diffs_dir/$diff_base.diff"
+ diff $DIFF_OPTIONS -r "$res_dir_used" "${outdir}$dir" 2>>$logfile >
"$testdir/$diffs_dir/$diff_base.diff"
dif_ret=$?
if [ $dif_ret != 0 ]; then
echo "D: $testdir/$diffs_dir/$diff_base.diff (printed below)"