]> arthur.barton.de Git - bup.git/commitdiff
test-cat-file.sh: use -l instead of -b; explain differences.
authorRob Browning <rlb@defaultvalue.org>
Thu, 31 Oct 2013 15:23:24 +0000 (10:23 -0500)
committerRob Browning <rlb@defaultvalue.org>
Fri, 1 Nov 2013 23:52:40 +0000 (18:52 -0500)
It turns out that cmp -b doesn't work on at least NetBSD, so use -l
instead, and when there's a problem, diff the "bup meta" output as
well.

Thanks to Thomas Klausner <tk@giga.or.at> for the report.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
t/test-cat-file.sh

index 58a9da39cd72e40e9f665c5b2b6418b215cb7251..f0d7ebe30e4fce64a31d9201174ef5416e750256 100755 (executable)
@@ -35,6 +35,10 @@ bupm_hash=$(WVPASS git ls-tree "$src_hash" | grep -F .bupm | cut -d' ' -f 3) \
     || exit $?
 bupm_hash=$(WVPASS echo "$bupm_hash" | cut -d' ' -f 1) || exit $?
 WVPASS git cat-file blob "$bupm_hash" > git-cat-bupm
-WVPASS cmp -b git-cat-bupm bup-cat-bupm
+if ! cmp git-cat-bupm bup-cat-bupm; then
+    cmp -l git-cat-bupm bup-cat-bupm
+    diff -uN <(bup meta -tvvf git-cat-bupm) <(bup meta -tvvf bup-cat-bupm)
+    WVPASS cmp git-cat-bupm bup-cat-bupm
+fi
 
 WVPASS rm -rf "$tmpdir"