From: Wayne Davison Date: Fri, 3 Feb 2006 17:54:18 +0000 (+0000) Subject: Improved check_perms() to work with a directory, to have better X-Git-Tag: v2.6.7pre1~78 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eace352b3936baf57185faee6a02ca42964423fb;p=thirdparty%2Frsync.git Improved check_perms() to work with a directory, to have better output on error, and to call test_fail on error. --- diff --git a/testsuite/rsync.fns b/testsuite/rsync.fns index a1902b70..73e36eed 100644 --- a/testsuite/rsync.fns +++ b/testsuite/rsync.fns @@ -70,7 +70,13 @@ rsync_ls_lR() { } check_perms() { - "$TOOLDIR/tls" "$1" | grep "^-$2" >/dev/null + perms=`"$TOOLDIR/tls" "$1" | sed 's/^[-d]\(.........\).*/\1/'` + if test $perms = $2; then + return 0 + fi + echo "permissions: $perms on $1" + echo "should be: $2" + test_fail "failed test $3" } rsync_getgroups() {