Commit | Line | Data |
---|---|---|
0254bd46 WD |
1 | #! /bin/sh |
2 | ||
3 | # Copyright (C) 2005 by Wayne Davison <wayned@samba.org> | |
4 | ||
c8d19f90 | 5 | # This program is distributable under the terms of the GNU GPL (see |
0254bd46 WD |
6 | # COPYING). |
7 | ||
8 | # Test rsync handling of various delete directives. | |
9 | ||
10 | . "$suitedir/rsync.fns" | |
11 | ||
12 | hands_setup | |
13 | ||
14 | makepath "$chkdir" | |
15 | ||
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/" | |
20 | ||
21 | checkit "$RSYNC -avv --remove-sent-files \ | |
22 | \"$fromdir/\" \"$todir/\"" "$chkdir/copy" "$todir" | |
23 | ||
24 | diff -r "$chkdir/empty" "$fromdir" | |
25 | ||
ff43d8b4 WD |
26 | # Make sure that --delete-excluded does not dump a per-dir merge-file filter. |
27 | cat >"$todir/filters" <<EOF | |
28 | P foo | |
29 | EOF | |
30 | touch "$todir/foo" | |
31 | ||
32 | $RSYNC -r --filter=': filters' --delete-excluded "$fromdir/" "$todir/" | |
33 | ||
34 | test -f "$todir/foo" || test_fail "rsync incorrectly elided the merge file" | |
35 | ||
0254bd46 WD |
36 | # The script would have aborted on error, so getting here means we've won. |
37 | exit 0 |