From: Rob Browning Date: Sun, 4 Aug 2013 18:39:55 +0000 (-0500) Subject: t/compare-trees: check rsync capability support correctly. X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=72516d9b2dfa4c98fa14ef8906e3e3353abb03ad;p=packages%2Fb%2Fbup.git t/compare-trees: check rsync capability support correctly. Handle older versions of rsync (where nothing was printed), and for newer versions, check for "no FOO" rather than "FOO", since FOO will always be listed one way or the other. Handle ACL and xattr support independently. Signed-off-by: Rob Browning Tested-by: Zoran Zaric Reviewed-by: Zoran Zaric --- diff --git a/t/compare-trees b/t/compare-trees index b611b0f..2568f5f 100755 --- a/t/compare-trees +++ b/t/compare-trees @@ -47,18 +47,24 @@ trap "rm -rf '${tmpfile}'" EXIT rsync_opts="-niaH$verify_content --delete" -if rsync --version | grep -q xattrs; then +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) - # bup doesn't support ACLs here yet. - rsync_opts="$rsync_opts -X" + echo "Not comparing ACLs (not yet supported on $OSTYPE)" 1>&2 ;; *) - rsync_opts="$rsync_opts -AX" + 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 - echo "Not comparing xattrs/acls (unsupported by available rsync)." 1>&2 + rsync_opts="$rsync_opts -X" fi rsync $rsync_opts "$src" "$dest" > "${tmpfile}"