blob: 4d578ed14ac84dd827101f76fc6991594bacb728 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
#!/bin/sh
# Copyright (C) 2005 by Wayne Davison <wayned@samba.org>
#
# This program is distributable under the terms of the GNU GPL (see COPYING)
. "$suitedir/rsync.fns"
deepstr='down/3/deep'
deepdir="$fromdir/$deepstr"
extradir="$fromdir/extra"
makepath "$deepdir" "$extradir/$deepstr" "$chkdir"
fromdir="$deepdir"
hands_setup
fromdir="$tmpdir/from"
extrafile="$extradir/./$deepstr/extra.added.value"
echo wowza >"$extrafile"
$RSYNC -av --existing --include='*/' --exclude='*' "$fromdir/" "$extradir/"
outfile="$scratchdir/rsync.out"
cd "$fromdir"
# Main script starts here
$RSYNC -ai --include=/down/ --exclude='/*' "$fromdir/" "$chkdir/"
sleep 1
runtest "basic relative" 'checkit "$RSYNC -avR ./$deepstr \"$todir\"" "$chkdir" "$todir"'
ln $deepstr/filelist $deepstr/dir
ln ../chk/$deepstr/filelist ../chk/$deepstr/dir
runtest "hard links" 'checkit "$RSYNC -avHR ./$deepstr/ \"$todir\"" "$chkdir" "$todir"'
cp "$deepdir/text" "$todir/$deepstr/ThisShouldGo"
cp "$deepdir/text" "$todir/$deepstr/dir/ThisShouldGoToo"
runtest "deletion" 'checkit "$RSYNC -avHR --del ./$deepstr/ \"$todir\"" "$chkdir" "$todir"'
runtest "non-deletion" 'checkit "$RSYNC -aiHR --del ./$deepstr/ \"$todir\"" "$chkdir" "$todir"' \
| tee "$outfile"
# Make sure no files were deleted
grep 'deleting ' "$outfile" && test_fail "Erroneous deletions occurred!"
# Relative with merging.
$RSYNC -ai "$extradir/down" "$chkdir/"
checkit "$RSYNC -aiR $deepstr '$extrafile' '$todir'" "$chkdir" "$todir"
checkit "$RSYNC -aiR --del $deepstr '$extrafile' '$todir'" "$chkdir" "$todir" \
| tee "$outfile"
# Make sure no files were deleted
grep 'deleting ' "$outfile" && test_fail "Erroneous deletions occurred! (2)"
# The script would have aborted on error, so getting here means we've won.
exit 0
|