3 # Copyright (C) 2005-2020 Wayne Davison
5 # This program is distributable under the terms of the GNU GPL (see COPYING)
7 .
"$suitedir/rsync.fns"
10 deepdir
="$fromdir/$deepstr"
11 extradir
="$fromdir/extra"
12 makepath
"$deepdir" "$extradir/$deepstr" "$chkdir"
16 fromdir
="$tmpdir/from"
18 extrafile
="$extradir/./$deepstr/extra.added.value"
19 echo wowza
>"$extrafile"
21 $RSYNC -av --existing --include='*/' --exclude='*' "$fromdir/" "$extradir/"
25 # Main script starts here
27 $RSYNC -ai --include=/down
/ --exclude='/*' "$fromdir/" "$chkdir/"
30 runtest
"basic relative" 'checkit "$RSYNC -avR ./$deepstr \"$todir\"" "$chkdir" "$todir"'
32 ln $deepstr/filelist
$deepstr/dir
33 ln ..
/chk
/$deepstr/filelist ..
/chk
/$deepstr/dir
34 # Work around time rounding/truncating issue by touching both dirs.
35 touch -r $deepstr/dir
$deepstr/dir ..
/chk
/$deepstr/dir
36 runtest
"hard links" 'checkit "$RSYNC -avHR ./$deepstr/ \"$todir\"" "$chkdir" "$todir"'
38 cp "$deepdir/text" "$todir/$deepstr/ThisShouldGo"
39 cp "$deepdir/text" "$todir/$deepstr/dir/ThisShouldGoToo"
40 runtest
"deletion" 'checkit "$RSYNC -avHR --del ./$deepstr/ \"$todir\"" "$chkdir" "$todir"'
42 runtest
"non-deletion" 'checkit "$RSYNC -aiHR --del ./$deepstr/ \"$todir\"" "$chkdir" "$todir"' \
45 # Make sure no files were deleted
46 grep 'deleting ' "$outfile" && test_fail
"Erroneous deletions occurred!"
48 # Relative with merging.
49 $RSYNC -ai "$extradir/down" "$chkdir/"
51 checkit
"$RSYNC -aiR $deepstr '$extrafile' '$todir'" "$chkdir" "$todir"
53 checkit
"$RSYNC -aiR --del $deepstr '$extrafile' '$todir'" "$chkdir" "$todir" \
56 # Make sure no files were deleted
57 grep 'deleting ' "$outfile" && test_fail
"Erroneous deletions occurred! (2)"
59 # The script would have aborted on error, so getting here means we've won.