Use relative directories, and note that the merge code is only
[rsync/rsync.git] / testsuite / merge.test
1 #! /bin/sh
2
3 # Copyright (C) 2004 by Wayne Davison <wayned@samba.org>
4
5 # This program is distributable under the terms of the GNU GPL (see
6 # COPYING).
7
8 # Make sure we can merge files from multiple directories into one.
9
10 . "$suitedir/rsync.fns"
11
12 # Build some files/dirs/links to copy
13
14 # Use local dirnames to better exercise the arg-parsing code.
15 cd "$tmpdir"
16
17 mkdir from1 from2 from3
18 mkdir from2/sub1 from3/sub1
19 mkdir from3/sub2 from1/dir-and-not-dir
20 mkdir -p chk/sub1 chk/sub2 chk/dir-and-not-dir
21 echo "one" >from1/one
22 cp -p from1/one from2/one
23 cp -p from1/one from3/one
24 echo "two" >from1/two
25 echo "three" >from2/three
26 echo "four" >from3/four
27 echo "five" >from1/five
28 echo "six" >from3/six
29 echo "sub1" >from2/sub1/uno
30 cp -p from2/sub1/uno from3/sub1/uno
31 echo "sub2" >from3/sub1/dos
32 echo "sub3" >from2/sub1/tres
33 echo "subby" >from3/sub2/subby
34 echo "extra" >from1/dir-and-not-dir/inside
35 echo "not-dir" >from3/dir-and-not-dir
36
37 cp -p from1/one from1/two from2/three from3/four from1/five from3/six chk
38 cp -p from1/dir-and-not-dir/inside chk/dir-and-not-dir
39 cp -p from2/sub1/uno from3/sub1/dos from2/sub1/tres chk/sub1
40 cp -p from3/sub2/subby chk/sub2
41
42 # Get rid of any directory-time differences
43 $RSYNC -av --existing -f 'exclude,! */' from1/ from2/
44 $RSYNC -av --existing -f 'exclude,! */' from2/ from3/
45 $RSYNC -av --existing -f 'exclude,! */' from1/ chk/
46 $RSYNC -av --existing -f 'exclude,! */' from3/ chk/
47
48 # TODO: fix inc-recurse unduplications of directory contents!
49 checkit "$RSYNC -avv --no-ir from1/ from2/ from3/ to/" chk to
50
51 # The script would have aborted on error, so getting here means we've won.
52 exit 0