3 # Copyright (C) 2005 by Wayne Davison <wayned@samba.org>
5 # This program is distributable under the terms of the GNU GPL (see
8 # Test rsync handling of various delete directives.
10 . "$suitedir/rsync.fns"
16 # Create two chk dirs, one with a copy of the source files, and one with
17 # what we expect to be left behind by the copy using --remove-sent-files.
18 $RSYNC -av "$fromdir/" "$chkdir/copy/"
19 $RSYNC -av -f 'exclude,! */' "$fromdir/" "$chkdir/empty/"
21 checkit "$RSYNC -avv --remove-sent-files \
22 \"$fromdir/\" \"$todir/\"" "$chkdir/copy" "$todir"
24 diff -r "$chkdir/empty" "$fromdir"
26 # Make sure that "P" but not "-" per-dir merge-file filters take effect with
28 cat >"$todir/filters" <<EOF
32 touch "$todir/foo" "$todir/bar" "$todir/baz"
34 $RSYNC -r --exclude=baz --filter=': filters' --delete-excluded "$fromdir/" "$todir/"
36 test -f "$todir/foo" || test_fail "rsync deleted $todir/foo"
37 test -f "$todir/bar" && test_fail "rsync did not delete $todir/bar"
38 test -f "$todir/baz" && test_fail "rsync did not delete $todir/baz"
40 # The script would have aborted on error, so getting here means we've won.