From: Bruno Haible Date: Fri, 2 Sep 2011 08:51:52 +0000 (+0200) Subject: tests: init.sh: work also with any non-GNU diff that supports -u X-Git-Tag: v8.13~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0cefe580926e17c8781e8140bd9912795b6e21cc;p=thirdparty%2Fcoreutils.git tests: init.sh: work also with any non-GNU diff that supports -u * tests/init.sh: Relax check for diff -u support. Rather than checking for GNU diff via --version, simply check for support for -u itself. Useful at least on OpenBSD 4.9. --- diff --git a/tests/init.sh b/tests/init.sh index 460937de4f..12b3ca37e1 100644 --- a/tests/init.sh +++ b/tests/init.sh @@ -221,7 +221,7 @@ export MALLOC_PERTURB_ # a partition, or to undo any other global state changes. cleanup_ () { :; } -if ( diff --version < /dev/null 2>&1 | grep GNU ) > /dev/null 2>&1; then +if ( diff -u "$0" "$0" < /dev/null ) > /dev/null 2>&1; then compare () { diff -u "$@"; } elif ( cmp --version < /dev/null 2>&1 | grep GNU ) > /dev/null 2>&1; then compare () { cmp -s "$@"; }