From: Akim Demaille Date: Fri, 18 Feb 2000 13:44:17 +0000 (+0000) Subject: Some `diff' refuse to diff with /dev/null, such as Tru64's. X-Git-Tag: autoconf-2.50~1129 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c34897ff86704bbd30224eabbe6bb24a52f4d150;p=thirdparty%2Fautoconf.git Some `diff' refuse to diff with /dev/null, such as Tru64's. Reported by Nicolas Joly. * tests/atgeneral.m4 (empty): New dummy file. Changed various `diff /dev/null' as `diff empty'. --- diff --git a/ChangeLog b/ChangeLog index fd53c65c1..dbb9fa64d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2000-02-18 Akim Demaille + + Some `diff' refuse to diff with /dev/null, such as Tru64's. + Reported by Nicolas Joly. + + * tests/atgeneral.m4 (empty): New dummy file. + Changed various `diff /dev/null' as `diff empty'. + 2000-02-18 Akim Demaille * tests/atspecific.m4 (TEST_MACRO): Don't run AC_PATH_TOOL and diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4 index ce6c6cf15..3d4b4cadf 100644 --- a/lib/autotest/general.m4 +++ b/lib/autotest/general.m4 @@ -139,9 +139,12 @@ done # environments, `diff' considers that two files are equal included # when there are only differences on the coding of new lines. `cmp' # does not. -# Finally, not all the `diff' support `-u'. +# +# Finally, not all the `diff' support `-u', and some, like Tru64, even +# refuse to `diff' /dev/null. +: >empty -if diff -u /dev/null /dev/null >/dev/null 2>&1; then +if diff -u empty empty >/dev/null 2>&1; then at_diff='diff -u' else at_diff='diff' @@ -370,13 +373,13 @@ if test -z "$at_no_redirs"; then ignore, [test -n "$at_verbose" && cat stdout;:], expout, [AT_DEFINE([AT_data_expout], [ expout])dnl $at_diff expout stdout || exit 1], - [], [$at_diff /dev/null stdout || exit 1], + [], [$at_diff empty stdout || exit 1], [echo $at_n "patsubst([$3], [\([\"`$]\)], \\\1)$at_c" | $at_diff - stdout || exit 1]) AT_CASE([$4], ignore, [test -n "$at_verbose" && cat stderr;:], experr, [AT_DEFINE([AT_data_experr], [ experr])dnl $at_diff experr stderr || exit 1], - [], [$at_diff /dev/null stderr || exit 1], + [], [$at_diff empty stderr || exit 1], [echo $at_n "patsubst([$4], [\([\"`$]\)], \\\1)$at_c" | $at_diff - stderr || exit 1]) fi $at_traceon diff --git a/tests/atgeneral.m4 b/tests/atgeneral.m4 index ce6c6cf15..3d4b4cadf 100644 --- a/tests/atgeneral.m4 +++ b/tests/atgeneral.m4 @@ -139,9 +139,12 @@ done # environments, `diff' considers that two files are equal included # when there are only differences on the coding of new lines. `cmp' # does not. -# Finally, not all the `diff' support `-u'. +# +# Finally, not all the `diff' support `-u', and some, like Tru64, even +# refuse to `diff' /dev/null. +: >empty -if diff -u /dev/null /dev/null >/dev/null 2>&1; then +if diff -u empty empty >/dev/null 2>&1; then at_diff='diff -u' else at_diff='diff' @@ -370,13 +373,13 @@ if test -z "$at_no_redirs"; then ignore, [test -n "$at_verbose" && cat stdout;:], expout, [AT_DEFINE([AT_data_expout], [ expout])dnl $at_diff expout stdout || exit 1], - [], [$at_diff /dev/null stdout || exit 1], + [], [$at_diff empty stdout || exit 1], [echo $at_n "patsubst([$3], [\([\"`$]\)], \\\1)$at_c" | $at_diff - stdout || exit 1]) AT_CASE([$4], ignore, [test -n "$at_verbose" && cat stderr;:], experr, [AT_DEFINE([AT_data_experr], [ experr])dnl $at_diff experr stderr || exit 1], - [], [$at_diff /dev/null stderr || exit 1], + [], [$at_diff empty stderr || exit 1], [echo $at_n "patsubst([$4], [\([\"`$]\)], \\\1)$at_c" | $at_diff - stderr || exit 1]) fi $at_traceon