--- embedaddon/rsync/testsuite/chown.test 2013/10/14 07:51:15 1.1.1.2 +++ embedaddon/rsync/testsuite/chown.test 2021/03/17 00:32:36 1.1.1.3 @@ -15,7 +15,7 @@ case $0 in *fake*) - $RSYNC --version | grep ", xattrs" >/dev/null || test_skipped "Rsync needs xattrs for fake device tests" + $RSYNC --version | grep "[, ] xattrs" >/dev/null || test_skipped "Rsync needs xattrs for fake device tests" RSYNC="$RSYNC --fake-super" TLS_ARGS="$TLS_ARGS --fake-super" case "$HOST_OS" in @@ -37,6 +37,13 @@ EOF done } ;; + freebsd*) + chown() { + own=$1 + shift + setextattr -h user "rsync.%stat" "100644 0,0 $own" "${@}" + } + ;; *) chown() { own=$1 @@ -48,15 +55,16 @@ EOF ;; *) RSYNC="$RSYNC --super" - case `get_testuid` in - '') ;; # If "id" failed, try to continue... - 0) ;; - *) if [ -e "$FAKEROOT_PATH" ]; then + my_uid=`get_testuid` + root_uid=`get_rootuid` + if test x"$my_uid" = x; then + : # If "id" failed, try to continue... + elif test x"$my_uid" != x"$root_uid"; then + if [ -e "$FAKEROOT_PATH" ]; then echo "Let's try re-running the script under fakeroot..." exec "$FAKEROOT_PATH" "$SHELL_PATH" "$0" fi - ;; - esac + fi ;; esac