X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=t%2Fcompare-trees;h=aeaa086a86d1fb92b92bdb902cb34166e42abc44;hb=HEAD;hp=5ef44a29edc396358afb71d73f50639c665a0e26;hpb=0e18f9a22a52fd3a73a83c9a8122fadb790510f9;p=bup.git diff --git a/t/compare-trees b/t/compare-trees deleted file mode 100755 index 5ef44a2..0000000 --- a/t/compare-trees +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env bash - -# Test that src and dest trees are as identical as bup is capable of -# making them. For now, use rsync -niaHAX ... - -usage() { -cat <&2; exit 1;; - esac -done - -shift $(($OPTIND - 1)) || exit $? - -if ! test $# -eq 2 -then - usage 1>&2 - exit 1 -fi - -src="$1" -dest="$2" - -tmpfile="$(mktemp /tmp/bup-test-XXXXXXX)" || exit $? -trap "rm -rf '$tmpfile'" EXIT || exit $? - -rsync_opts="-niaH$verify_content --delete" - -rsync_version=$(rsync --version) -if [[ ! "$rsync_version" =~ "ACLs" ]] || [[ "$rsync_version" =~ "no ACLs" ]]; then - echo "Not comparing ACLs (not supported by available rsync)" 1>&2 -else - case $OSTYPE in - cygwin|darwin) - echo "Not comparing ACLs (not yet supported on $OSTYPE)" 1>&2 - ;; - *) - rsync_opts="$rsync_opts -A" - ;; - esac -fi - -if [[ ! "$rsync_version" =~ "xattrs" ]] || [[ "$rsync_version" =~ "no xattrs" ]]; then - echo "Not comparing xattrs (not supported by available rsync)" 1>&2 -else - rsync_opts="$rsync_opts -X" -fi - -rsync $rsync_opts "$src" "$dest" > "$tmpfile" || exit $? - -if test $(wc -l < "$tmpfile") != 0; then - echo "Differences between $src and $dest" - cat "$tmpfile" - exit 1 -fi - -exit 0