version 1.1.1.1, 2012/02/17 15:09:30
|
version 1.1.1.2, 2021/03/17 00:32:36
|
Line 1
|
Line 1
|
#! /bin/sh |
#! /bin/sh |
|
|
# Copyright (C) 2003, 2004, 2005 by Wayne Davison <wayned@samba.org> | # Copyright (C) 2003-2020 Wayne Davison |
|
|
# This program is distributable under the terms of the GNU GPL (see |
# This program is distributable under the terms of the GNU GPL (see |
# COPYING). |
# COPYING). |
Line 12
|
Line 12
|
|
|
. "$suitedir/rsync.fns" |
. "$suitedir/rsync.fns" |
|
|
|
chkfile="$scratchdir/rsync.chk" |
|
outfile="$scratchdir/rsync.out" |
|
|
CVSIGNORE='*.junk' |
CVSIGNORE='*.junk' |
export CVSIGNORE |
export CVSIGNORE |
|
|
Line 113 rm -rf "$todir"
|
Line 116 rm -rf "$todir"
|
# Add a directory symlink. |
# Add a directory symlink. |
ln -s too "$fromdir/bar/down/to/foo/sym" |
ln -s too "$fromdir/bar/down/to/foo/sym" |
|
|
|
# Start to prep an --update test dir |
|
mkdir "$scratchdir/up1" "$scratchdir/up2" |
|
touch "$scratchdir/up1/older" "$scratchdir/up2/newer" |
|
touch "$scratchdir/up1/extra-src" "$scratchdir/up2/extra-dest" |
|
|
# Create chkdir with what we expect to be excluded. |
# Create chkdir with what we expect to be excluded. |
checkit "$RSYNC -avv '$fromdir/' '$chkdir/'" "$fromdir" "$chkdir" |
checkit "$RSYNC -avv '$fromdir/' '$chkdir/'" "$fromdir" "$chkdir" |
sleep 1 # Ensures that the rm commands will tweak the directory times. |
sleep 1 # Ensures that the rm commands will tweak the directory times. |
Line 124 rm "$chkdir"/foo/file[235-9]
|
Line 132 rm "$chkdir"/foo/file[235-9]
|
rm "$chkdir"/bar/down/to/foo/to "$chkdir"/bar/down/to/foo/file[235-9] |
rm "$chkdir"/bar/down/to/foo/to "$chkdir"/bar/down/to/foo/file[235-9] |
rm "$chkdir"/mid/for/foo/extra |
rm "$chkdir"/mid/for/foo/extra |
|
|
|
# Finish prep for the --update test (run last) |
|
touch "$scratchdir/up1/newer" "$scratchdir/up2/older" |
|
|
# Un-tweak the directory times in our first (weak) exclude test (though |
# Un-tweak the directory times in our first (weak) exclude test (though |
# it's a good test of the --existing option). |
# it's a good test of the --existing option). |
$RSYNC -av --existing --include='*/' --exclude='*' "$fromdir/" "$chkdir/" |
$RSYNC -av --existing --include='*/' --exclude='*' "$fromdir/" "$chkdir/" |
Line 214 $RSYNC -av $relative_opts --existing --filter='-! */'
|
Line 225 $RSYNC -av $relative_opts --existing --filter='-! */'
|
|
|
checkit "$RSYNC -avv $relative_opts --exclude='$fromdir/foo/down' \ |
checkit "$RSYNC -avv $relative_opts --exclude='$fromdir/foo/down' \ |
'$fromdir/foo' '$todir'" "$chkdir$fromdir/foo" "$todir$fromdir/foo" |
'$fromdir/foo' '$todir'" "$chkdir$fromdir/foo" "$todir$fromdir/foo" |
|
|
|
# Now we'll test the --update option. |
|
$RSYNC -aiO --update touch "$scratchdir/up1/" "$scratchdir/up2/" \ |
|
| tee "$outfile" |
|
cat <<EOT >"$chkfile" |
|
>f$all_plus extra-src |
|
>f..t.$dots newer |
|
EOT |
|
diff $diffopt "$chkfile" "$outfile" || test_fail "--update test failed" |
|
|
# The script would have aborted on error, so getting here means we've won. |
# The script would have aborted on error, so getting here means we've won. |
exit 0 |
exit 0 |