tests: init.sh: Support any non-GNU diff.
authorBruno Haible <bruno@clisp.org>
Fri, 2 Sep 2011 16:27:55 +0000 (18:27 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 2 Sep 2011 16:27:55 +0000 (18:27 +0200)
* tests/init.sh (compare): If "diff -c" is supported but "diff -u" is
not, use "diff -c". Useful on AIX 6.1, HP-UX 11.31, OSF/1 5.1,
Solaris 8.

ChangeLog
tests/init.sh

index 1c292ab..b2d7cb1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,17 @@
 2011-09-02  Bruno Haible  <bruno@clisp.org>
 
+       tests: init.sh: Support any non-GNU diff.
+       * tests/init.sh (compare): If "diff -c" is supported but "diff -u" is
+       not, use "diff -c". Useful on AIX 6.1, HP-UX 11.31, OSF/1 5.1,
+       Solaris 8.
+
+2011-09-02  Bruno Haible  <bruno@clisp.org>
+
        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,
-       AIX 7.1, IRIX 6.5 and Solaris 10.
+       AIX 7.1, IRIX 6.5, and Solaris 10.
 
 2011-09-01  Bruno Haible  <bruno@clisp.org>
 
index d3fb28c..e6f5f1c 100644 (file)
@@ -210,6 +210,8 @@ cleanup_ () { :; }
 
 if ( diff -u "$0" "$0" < /dev/null ) > /dev/null 2>&1; then
   compare () { diff -u "$@"; }
+elif ( diff -c "$0" "$0" < /dev/null ) > /dev/null 2>&1; then
+  compare () { diff -c "$@"; }
 elif ( cmp --version < /dev/null 2>&1 | grep GNU ) > /dev/null 2>&1; then
   compare () { cmp -s "$@"; }
 else