We now figure out if diff accepts -u and we'll use it instead of -c,
authorWayne Davison <wayned@samba.org>
Sat, 5 Jul 2003 22:57:08 +0000 (22:57 +0000)
committerWayne Davison <wayned@samba.org>
Sat, 5 Jul 2003 22:57:08 +0000 (22:57 +0000)
if possible.

testsuite/rsync.fns
testsuite/trimslash.test
testsuite/wildmatch.test

index 42b7b7e..19e88aa 100644 (file)
@@ -27,6 +27,12 @@ RSYNC="$rsync_bin"
 # Berkley's nice.
 PATH="$PATH:/usr/ucb"
 
+if diff -u $srcdir/testsuite/rsync.fns $srcdir/testsuite/rsync.fns >/dev/null 2>&1; then
+    diffopt="-u"
+else
+    diffopt="-c"
+fi
+
 runtest() {
     echo $ECHO_N "Test $1: $ECHO_C"
     if eval "$2"
@@ -157,7 +163,7 @@ checkit() {
     echo ""
     for f in `cd "$2"; find . -type f -print `
     do 
-        diff -c "$2"/"$f" "$3"/"$f" || failed=YES
+        diff $diffopt "$2"/"$f" "$3"/"$f" || failed=YES
     done
 
     echo "-------------"
@@ -165,7 +171,7 @@ checkit() {
     echo ""
     ( cd "$2" && rsync_ls_lR . ) > ${TMP}/ls-from 
     ( cd "$3" && rsync_ls_lR . ) > ${TMP}/ls-to 
-    diff -c ${TMP}/ls-from ${TMP}/ls-to || failed=YES
+    diff $diffopt ${TMP}/ls-from ${TMP}/ls-to || failed=YES
     if [ -z "${failed}" ] ; then
        return 0
     else
index cf11840..a22906a 100644 (file)
@@ -15,7 +15,7 @@ set -x
        "//a//" "////" \
         "/Users/Wierd Macintosh Name/// Ooh, translucent plastic/" \
        > "$scratchdir/slash.out"
-diff -c "$scratchdir/slash.out" - <<EOF
+diff $diffopt "$scratchdir/slash.out" - <<EOF
 /usr/local/bin
 /usr/local/bin
 /usr/local/bin
@@ -25,5 +25,3 @@ diff -c "$scratchdir/slash.out" - <<EOF
 EOF
 
 exit 0
-# last [] may have failed but if we get here then we've won
-
index 3366dd5..4bfddbc 100644 (file)
@@ -12,7 +12,7 @@
 set -x
 
 "$TOOLDIR/wildtest" >"$scratchdir/wild.out"
-diff -c "$scratchdir/wild.out" - <<EOF
+diff $diffopt "$scratchdir/wild.out" - <<EOF
 EOF
 
 exit 0