X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/48ffc11e9cd35d57f518a5cac8e56d79d424ca04..7e4b6b7bc47b8ac00fa295ed60e6e13e28fd1a8a:/testsuite/delete.test diff --git a/testsuite/delete.test b/testsuite/delete.test index bab92a12..fae8fe26 100644 --- a/testsuite/delete.test +++ b/testsuite/delete.test @@ -11,9 +11,7 @@ hands_setup -makepath "$chkdir" -makepath "$todir/extradir" -makepath "$todir/emptydir/subdir" +makepath "$chkdir" "$todir/extradir" "$todir/emptydir/subdir" echo extra >"$todir"/remove1 echo extra >"$todir"/remove2 @@ -22,7 +20,19 @@ echo extra >"$todir"/emptydir/subdir/remove4 # Create two chk dirs, one with a copy of the source files, and one with # what we expect to be left behind by the copy using --remove-source-files. -$RSYNC -av "$fromdir/" "$chkdir/copy/" +# Also, make sure that --dry-run --del doesn't output anything extraneous. +$RSYNC -av "$fromdir/" "$chkdir/copy/" >"$tmpdir/copy.out" 2>&1 +cat "$tmpdir/copy.out" +egrep -v '^(created directory|sent|total size) ' "$tmpdir/copy.out" >"$tmpdir/copy.new" +mv "$tmpdir/copy.new" "$tmpdir/copy.out" + +$RSYNC -avn --del "$fromdir/" "$chkdir/copy2/" >"$tmpdir/copy2.out" 2>&1 || true +cat "$tmpdir/copy2.out" +egrep -v '^(created directory|sent|total size) ' "$tmpdir/copy2.out" >"$tmpdir/copy2.new" +mv "$tmpdir/copy2.new" "$tmpdir/copy2.out" + +diff $diffopt "$tmpdir/copy.out" "$tmpdir/copy2.out" + $RSYNC -av -f 'exclude,! */' "$fromdir/" "$chkdir/empty/" checkit "$RSYNC -avv --del --remove-source-files \