]> arthur.barton.de Git - bup.git/commitdiff
Don't pass -AX to rsync in t/compare-trees if xattrs aren't supported.
authorRob Browning <rlb@defaultvalue.org>
Tue, 11 Sep 2012 00:36:18 +0000 (19:36 -0500)
committerRob Browning <rlb@defaultvalue.org>
Sun, 27 Jan 2013 22:29:45 +0000 (16:29 -0600)
The -AX options won't be available if rsync doesn't report the xattr
capability, so test for that before trying to use them.

Thanks to Yung-Chin Oei <yungchin@yungchin.nl> for the suggested
approach and initial report.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
t/compare-trees

index b7fd28e1dd133f85e4f0846c95a92c98deec4315..30b6daed8adc13580e1d41222653ae55d5ee8afa 100755 (executable)
@@ -45,7 +45,16 @@ dest="$2"
 tmpfile="$(mktemp)"
 trap "rm -rf '${tmpfile}'" EXIT
 
-rsync -niaHAX$verify_content --delete "$src" "$dest" > "${tmpfile}"
+rsync_opts="-niaH$verify_content --delete"
+
+if rsync --version | grep -q xattrs; then
+    rsync_opts="$rsync_opts -AX"
+else
+    echo "Not comparing xattrs/acls (unsupported by available rsync)." 1>&2
+fi
+
+rsync $rsync_opts "$src" "$dest" > "${tmpfile}"
+
 if test $(wc -l < "${tmpfile}") != 0; then
     echo "Differences between $src and $dest"
     cat "${tmpfile}"