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