Yet another manpage tweak.
[rsync.git] / testsuite / files-from.test
blob207eab5f2d41686e54ab13fa41b887565188f454
1 #!/bin/sh
3 # Copyright (C) 2008-2020 Wayne Davison
5 # This program is distributable under the terms of the GNU GPL (see
6 # COPYING).
8 # Test that --files-from=FILE works right.
10 . "$suitedir/rsync.fns"
12 SSH="$scratchdir/src/support/lsh.sh"
14 hands_setup
16 # This list of files skips the contents of "subsubdir" but includes
17 # the contents of "subsubdir2" due to its trailing slash.
18 cat >"$scratchdir/filelist" <<EOT
19 from/./
20 from/./dir/subdir
21 from/./dir/subdir/subsubdir
22 from/./dir/subdir/subsubdir2/
23 from/./dir/subdir/foobar.baz
24 EOT
26 # Create a chkdir without the content that we expect to be omitted.
27 $RSYNC -a --exclude=dir/text --exclude='subsubdir/**' "$fromdir/" "$chkdir/"
29 checkit "$RSYNC -av --files-from='$scratchdir/filelist' '$scratchdir' '$todir/'" "$chkdir" "$todir"
31 for filehost in '' 'localhost:'; do
32 for srchost in '' 'localhost:'; do
33 if [ -z "$srchost" ]; then
34 desthost='localhost:'
35 else
36 desthost=''
39 rm -rf "$todir"
40 checkit "$RSYNC -avse '$SSH' --rsync-path='$RSYNC' --files-from='$filehost$scratchdir/filelist' '$srchost$scratchdir' '$desthost$todir/'" "$chkdir" "$todir"
41 done
42 done
44 # The script would have aborted on error, so getting here means we've won.
45 exit 0