Browse files

Don't pass -AX to rsync in t/compare-trees if xattrs aren't supported.

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 <> for the suggested
approach and initial report.

Signed-off-by: Rob Browning <>
Reviewed-by: Zoran Zaric <>
  • Loading branch information...
1 parent 637bf18 commit 7a1c342400d1eabe00bc1ba00eafd64080d21d72 @rlbdv rlbdv committed Sep 11, 2012
Showing with 10 additions and 1 deletion.
  1. +10 −1 t/compare-trees
11 t/compare-trees
@@ -45,7 +45,16 @@ dest="$2"
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"
+ echo "Not comparing xattrs/acls (unsupported by available rsync)." 1>&2
+rsync $rsync_opts "$src" "$dest" > "${tmpfile}"
if test $(wc -l < "${tmpfile}") != 0; then
echo "Differences between $src and $dest"
cat "${tmpfile}"

0 comments on commit 7a1c342

Please sign in to comment.