X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/571a4b265410cdc6b8301580f2b04ee29cff214a..42d0b4c280dfbc2a557e84528ac176d652d3b5e6:/testsuite/rsync.fns diff --git a/testsuite/rsync.fns b/testsuite/rsync.fns index a583c159..8f8e7d3c 100644 --- a/testsuite/rsync.fns +++ b/testsuite/rsync.fns @@ -21,7 +21,6 @@ TMP="$scratchdir" FROM=${TMP}/from TO=${TMP}/to -F1=text1 LOG=${TMP}/log RSYNC="$rsync_bin" @@ -42,6 +41,11 @@ printmsg() { } +rsync_ls_lR() { + find "$@" -print | sort | xargs $TLS +} + + #################### # Build test directories TO and FROM, with FROM full of files. @@ -68,22 +72,25 @@ hands_setup() { mkdir ${FROM}/emptydir # a hundred lines of text or so - ls -lR $(srcdir) >${FROM}/filelist + rsync_ls_lR ${srcdir} > ${FROM}/filelist # This might fail on systems that don't have -n echo $ECHO_N "This file has no trailing lf$ECHO_C" > ${FROM}/nolf umask 0 ln -s nolf ${FROM}/nolf-symlink - umask 077 + umask 022 - cat $srcdir/*.c > ${FROM}/${F1} + cat $srcdir/*.c > ${FROM}/text mkdir ${FROM}/dir - cp ${FROM}/${F1} ${FROM}/dir + cp ${FROM}/text ${FROM}/dir mkdir ${FROM}/dir/subdir mkdir ${FROM}/dir/subdir/subsubdir ls -ltr /etc > ${FROM}/dir/subdir/subsubdir/etc-ltr-list mkdir ${FROM}/dir/subdir/subsubdir2 ls -lt /bin > ${FROM}/dir/subdir/subsubdir2/bin-lt-list + +# echo testing head: +# ls -lR ${srcdir} | head -10 || echo failed } @@ -93,6 +100,7 @@ hands_setup() { # Many machines do not have "mkdir -p", so we have to build up long paths. # How boring. makepath () { + echo " makepath $1" p="$1" ( # Absolut Unix. @@ -104,8 +112,12 @@ makepath () { # This will break if $1 contains a space. for c in `echo $p | tr '/' ' '` do - [ -d "$c" ] || mkdir "$c" || return $? - cd "$c" || return $? + if [ -d "$c" ] || mkdir "$c" + then + cd "$c" || return $? + else + echo "failed to create $c" >&2; return $? + fi done ) } @@ -137,8 +149,8 @@ checkit() { echo "-------------">>${log} echo "check how the directory listings compare with diff:">>${log} echo "">>${log} - ( cd $2 ; ls -laR ) > ${TMP}/ls-from 2>>${log} - ( cd $3 ; ls -laR ) > ${TMP}/ls-to 2>>${log} + ( cd "$2" && rsync_ls_lR ) > ${TMP}/ls-from 2>>${log} + ( cd "$3" && rsync_ls_lR ) > ${TMP}/ls-to 2>>${log} diff -c ${TMP}/ls-from ${TMP}/ls-to >>${log} 2>&1 || failed=YES if [ -z "${failed}" ] ; then rm $log