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 | ||
7892e5ac | 10 | . "$suitedir/rsync.fns" |
12865a97 | 11 | |
12865a97 WD |
12 | # Build some files/dirs/links to copy |
13 | ||
12865a97 WD |
14 | from1dir="${fromdir}1" |
15 | from2dir="${fromdir}2" | |
16 | from3dir="${fromdir}3" | |
12865a97 WD |
17 | |
18 | mkdir "$from1dir" "$from2dir" "$from3dir" | |
19 | mkdir "$from2dir"/sub1 "$from3dir"/sub1 | |
905d906d | 20 | mkdir "$from3dir"/sub2 "$from1dir"/dir-and-not-dir |
24b2096e | 21 | mkdir "$chkdir" "$chkdir"/sub1 "$chkdir"/sub2 "$chkdir"/dir-and-not-dir |
12865a97 | 22 | echo "one" >"$from1dir"/one |
284d628a WD |
23 | cp -p "$from1dir"/one "$from2dir"/one |
24 | cp -p "$from1dir"/one "$from3dir"/one | |
12865a97 WD |
25 | echo "two" >"$from1dir"/two |
26 | echo "three" >"$from2dir"/three | |
27 | echo "four" >"$from3dir"/four | |
28 | echo "five" >"$from1dir"/five | |
29 | echo "six" >"$from3dir"/six | |
30 | echo "sub1" >"$from2dir"/sub1/uno | |
284d628a | 31 | cp -p "$from2dir"/sub1/uno "$from3dir"/sub1/uno |
12865a97 WD |
32 | echo "sub2" >"$from3dir"/sub1/dos |
33 | echo "sub3" >"$from2dir"/sub1/tres | |
34 | echo "subby" >"$from3dir"/sub2/subby | |
24b2096e | 35 | echo "extra" >"$from1dir"/dir-and-not-dir/inside |
905d906d | 36 | echo "not-dir" >"$from3dir"/dir-and-not-dir |
12865a97 WD |
37 | |
38 | cp -p "$from1dir"/one "$from1dir"/two "$from2dir"/three "$from3dir"/four "$from1dir"/five "$from3dir"/six "$chkdir" | |
24b2096e | 39 | cp -p "$from1dir"/dir-and-not-dir/inside "$chkdir"/dir-and-not-dir |
12865a97 WD |
40 | cp -p "$from2dir"/sub1/uno "$from3dir"/sub1/dos "$from2dir"/sub1/tres "$chkdir"/sub1 |
41 | cp -p "$from3dir"/sub2/subby "$chkdir"/sub2 | |
42 | ||
284d628a | 43 | # Get rid of any directory-time differences |
2f24fb18 WD |
44 | $RSYNC -av --existing -f 'exclude,! */' "$from1dir/" "$from2dir/" |
45 | $RSYNC -av --existing -f 'exclude,! */' "$from2dir/" "$from3dir/" | |
46 | $RSYNC -av --existing -f 'exclude,! */' "$from1dir/" "$chkdir/" | |
47 | $RSYNC -av --existing -f 'exclude,! */' "$from3dir/" "$chkdir/" | |
12865a97 | 48 | |
6e06d2f3 | 49 | checkit "$RSYNC -aHvv \"$from1dir/\" \"$from2dir/\" \"$from3dir/\" \"$todir/\"" "$chkdir" "$todir" |
12865a97 | 50 | |
05118158 | 51 | # The script would have aborted on error, so getting here means we've won. |
12865a97 | 52 | exit 0 |