| 1 | #!/bin/sh |
| 2 | |
| 3 | # Copyright (C) 2008 by Wayne Davison <wayned@samba.org> |
| 4 | |
| 5 | # This program is distributable under the terms of the GNU GPL (see |
| 6 | # COPYING). |
| 7 | |
| 8 | # Test that --files-from=FILE works right. |
| 9 | |
| 10 | . "$suitedir/rsync.fns" |
| 11 | |
| 12 | hands_setup |
| 13 | |
| 14 | # This list of files skips the contents of "subsubdir" but includes |
| 15 | # the contents of "subsubdir2" due to its trailing slash. |
| 16 | cat >"$scratchdir/filelist" <<EOT |
| 17 | from/./ |
| 18 | from/./dir/subdir |
| 19 | from/./dir/subdir/subsubdir |
| 20 | from/./dir/subdir/subsubdir2/ |
| 21 | from/./dir/subdir/foobar.baz |
| 22 | EOT |
| 23 | |
| 24 | # Create a chkdir without the content that we expect to be omitted. |
| 25 | $RSYNC -a --exclude=dir/text --exclude='subsubdir/**' "$fromdir/" "$chkdir/" |
| 26 | |
| 27 | checkit "$RSYNC -av --files-from='$scratchdir/filelist' '$scratchdir' '$todir/'" "$chkdir" "$todir" |
| 28 | |
| 29 | # The script would have aborted on error, so getting here means we've won. |
| 30 | exit 0 |