Commit | Line | Data |
---|---|---|
12865a97 WD |
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 | . $srcdir/testsuite/rsync.fns | |
11 | ||
12 | set -x | |
13 | ||
14 | # Build some files/dirs/links to copy | |
15 | ||
16 | fromdir="$scratchdir/from" | |
17 | from1dir="${fromdir}1" | |
18 | from2dir="${fromdir}2" | |
19 | from3dir="${fromdir}3" | |
20 | todir="$scratchdir/to" | |
21 | chkdir="$scratchdir/chk" | |
22 | ||
23 | mkdir "$from1dir" "$from2dir" "$from3dir" | |
24 | mkdir "$from2dir"/sub1 "$from3dir"/sub1 | |
25 | mkdir "$from3dir"/sub2 | |
26 | mkdir "$chkdir" "$chkdir"/sub1 "$chkdir"/sub2 | |
27 | echo "one" >"$from1dir"/one | |
28 | echo "uno" >"$from2dir"/one | |
29 | echo "1" >"$from3dir"/one | |
30 | echo "two" >"$from1dir"/two | |
31 | echo "three" >"$from2dir"/three | |
32 | echo "four" >"$from3dir"/four | |
33 | echo "five" >"$from1dir"/five | |
34 | echo "six" >"$from3dir"/six | |
35 | echo "sub1" >"$from2dir"/sub1/uno | |
36 | echo "hmm1" >"$from3dir"/sub1/uno | |
37 | echo "sub2" >"$from3dir"/sub1/dos | |
38 | echo "sub3" >"$from2dir"/sub1/tres | |
39 | echo "subby" >"$from3dir"/sub2/subby | |
40 | ||
41 | cp -p "$from1dir"/one "$from1dir"/two "$from2dir"/three "$from3dir"/four "$from1dir"/five "$from3dir"/six "$chkdir" | |
42 | cp -p "$from2dir"/sub1/uno "$from3dir"/sub1/dos "$from2dir"/sub1/tres "$chkdir"/sub1 | |
43 | cp -p "$from3dir"/sub2/subby "$chkdir"/sub2 | |
44 | ||
45 | # Fix the directory times | |
46 | $RSYNC -av --include='*/' --exclude='*' "$from3dir/" "$chkdir/" | |
47 | $RSYNC -av --include='*/' --exclude='*' "$from2dir/" "$chkdir/" | |
48 | $RSYNC -av --include='*/' --exclude='*' "$from1dir/" "$chkdir/" | |
49 | ||
50 | checkit "$RSYNC -aHvv \"$fromdir\"?/ \"$todir/\"" "$chkdir" "$todir" | |
51 | ||
52 | exit 0 |