Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Change a variable name in read_a_msg().
[rsync/rsync.git]
/
testsuite
/
exclude.test
diff --git
a/testsuite/exclude.test
b/testsuite/exclude.test
index
9337560
..
099344f
100644
(file)
--- a/
testsuite/exclude.test
+++ b/
testsuite/exclude.test
@@
-5,7
+5,7
@@
# This program is distributable under the terms of the GNU GPL (see
# COPYING).
# This program is distributable under the terms of the GNU GPL (see
# COPYING).
-# Test rsync handling of exclude/include directives.
+# Test rsync handling of exclude/include directives.
# Test some of the more obscure wildcard handling of exclude/include
# processing.
# Test some of the more obscure wildcard handling of exclude/include
# processing.
@@
-76,7
+76,6
@@
EOF
echo cvsin >"$fromdir/mid/for/one-in-one-out"
echo expunged >"$fromdir/mid/for/foo/extra"
echo retained >"$fromdir/mid/for/foo/keep"
echo cvsin >"$fromdir/mid/for/one-in-one-out"
echo expunged >"$fromdir/mid/for/foo/extra"
echo retained >"$fromdir/mid/for/foo/keep"
-ln -s too "$fromdir/bar/down/to/foo/sym"
# Setup our test exclude/include files.
# Setup our test exclude/include files.
@@
-106,12
+105,17
@@
cat >"$scratchdir/.cvsignore" <<EOF
home-cvs-exclude
EOF
home-cvs-exclude
EOF
-# Create the chk dir with what we expect to be excluded
+# Start with a check of --prune-empty-dirs:
+$RSYNC -av -f -_foo/too/ -f -_foo/down/ -f -_foo/and/ -f -_new/ "$fromdir/" "$chkdir/"
+checkit "$RSYNC -av --prune-empty-dirs '$fromdir/' '$todir/'" "$chkdir" "$todir"
+rm -rf "$todir"
-checkit "$RSYNC -avv \"$fromdir/\" \"$chkdir/\"" "$fromdir" "$chkdir"
+# Add a directory symlink.
+ln -s too "$fromdir/bar/down/to/foo/sym"
+# Create chkdir with what we expect to be excluded.
+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.
-
rm -r "$chkdir"/foo/down
rm -r "$chkdir"/mid/for/foo/and
rm -r "$chkdir"/new/keep/this
rm -r "$chkdir"/foo/down
rm -r "$chkdir"/mid/for/foo/and
rm -r "$chkdir"/new/keep/this
@@
-126,8
+130,8
@@
$RSYNC -av --existing --include='*/' --exclude='*' "$fromdir/" "$chkdir/"
# Now, test if rsync excludes the same files.
# Now, test if rsync excludes the same files.
-checkit "$RSYNC -avv --exclude-from=
\"$excl\"
\
- --delete-during
\"$fromdir/\" \"$todir/\"
" "$chkdir" "$todir"
+checkit "$RSYNC -avv --exclude-from=
'$excl'
\
+ --delete-during
'$fromdir/' '$todir/'
" "$chkdir" "$todir"
# Modify the chk dir by removing cvs-ignored files and then tweaking the dir times.
# Modify the chk dir by removing cvs-ignored files and then tweaking the dir times.
@@
-142,29
+146,29
@@
$RSYNC -av --existing --filter='exclude,! */' "$fromdir/" "$chkdir/"
# Now, test if rsync excludes the same files, this time with --cvs-exclude
# and --delete-excluded.
# Now, test if rsync excludes the same files, this time with --cvs-exclude
# and --delete-excluded.
-checkit "$RSYNC -avvC --filter=
\"merge $excl\"
--delete-excluded \
- --delete-during
\"$fromdir/\" \"$todir/\"
" "$chkdir" "$todir"
+checkit "$RSYNC -avvC --filter=
'merge $excl'
--delete-excluded \
+ --delete-during
'$fromdir/' '$todir/'
" "$chkdir" "$todir"
# Modify the chk dir for our merge-exclude test and then tweak the dir times.
rm "$chkdir"/foo/file1
rm "$chkdir"/bar/down/to/bar/baz/*.deep
# Modify the chk dir for our merge-exclude test and then tweak the dir times.
rm "$chkdir"/foo/file1
rm "$chkdir"/bar/down/to/bar/baz/*.deep
-cp
-p
"$fromdir"/bar/down/to/foo/*.junk "$chkdir"/bar/down/to/foo
-cp
-p
"$fromdir"/bar/down/to/foo/to "$chkdir"/bar/down/to/foo
+cp
_touch
"$fromdir"/bar/down/to/foo/*.junk "$chkdir"/bar/down/to/foo
+cp
_touch
"$fromdir"/bar/down/to/foo/to "$chkdir"/bar/down/to/foo
$RSYNC -av --existing -f 'show .filt*' -f 'hide,! */' --del "$fromdir/" "$todir/"
echo retained >"$todir"/bar/down/to/bar/baz/nodel.deep
$RSYNC -av --existing -f 'show .filt*' -f 'hide,! */' --del "$fromdir/" "$todir/"
echo retained >"$todir"/bar/down/to/bar/baz/nodel.deep
-cp
-p
"$todir"/bar/down/to/bar/baz/nodel.deep "$chkdir"/bar/down/to/bar/baz
+cp
_touch
"$todir"/bar/down/to/bar/baz/nodel.deep "$chkdir"/bar/down/to/bar/baz
$RSYNC -av --existing --filter='-! */' "$fromdir/" "$chkdir/"
# Now, test if rsync excludes the same files, this time with a merge-exclude
# file.
$RSYNC -av --existing --filter='-! */' "$fromdir/" "$chkdir/"
# Now, test if rsync excludes the same files, this time with a merge-exclude
# file.
-checkit "sed '/!/d'
\"$excl\"
|
+checkit "sed '/!/d'
'$excl'
|
$RSYNC -avv -f dir-merge_.filt -f merge_- \
$RSYNC -avv -f dir-merge_.filt -f merge_- \
- --delete-during
\"$fromdir/\" \"$todir/\"
" "$chkdir" "$todir"
+ --delete-during
'$fromdir/' '$todir/'
" "$chkdir" "$todir"
# Remove the files that will be deleted.
# Remove the files that will be deleted.
@@
-180,9
+184,9
@@
$RSYNC -av --protocol=28 --existing --include='*/' --exclude='*' "$fromdir/" "$c
# Now, try the prior command with --delete-before and some side-specific
# rules.
# Now, try the prior command with --delete-before and some side-specific
# rules.
-checkit "sed '/!/d'
\"$excl\"
|
+checkit "sed '/!/d'
'$excl'
|
$RSYNC -avv -f :s_.filt -f .s_- -f P_nodel.deep \
$RSYNC -avv -f :s_.filt -f .s_- -f P_nodel.deep \
- --delete-before
\"$fromdir/\" \"$todir/\"
" "$chkdir" "$todir"
+ --delete-before
'$fromdir/' '$todir/'
" "$chkdir" "$todir"
# Next, we'll test some rule-restricted filter files.
# Next, we'll test some rule-restricted filter files.
@@
-201,14
+205,15
@@
$RSYNC -av --existing --filter='-! */' "$fromdir/" "$chkdir/"
$RSYNC -av --delete-excluded --exclude='*' "$fromdir/" "$todir/"
checkit "$RSYNC -avv -f dir-merge,-_.excl \
$RSYNC -av --delete-excluded --exclude='*' "$fromdir/" "$todir/"
checkit "$RSYNC -avv -f dir-merge,-_.excl \
-
\"$fromdir/\" \"$todir/\"
" "$chkdir" "$todir"
+
'$fromdir/' '$todir/'
" "$chkdir" "$todir"
-$RSYNC -avR "$fromdir/foo" "$chkdir/"
+relative_opts='--relative --chmod=Du+w --copy-unsafe-links'
+$RSYNC -av $relative_opts "$fromdir/foo" "$chkdir/"
rm -rf "$chkdir$fromdir/foo/down"
rm -rf "$chkdir$fromdir/foo/down"
-$RSYNC -av
R
--existing --filter='-! */' "$fromdir/foo" "$chkdir/"
+$RSYNC -av
$relative_opts
--existing --filter='-! */' "$fromdir/foo" "$chkdir/"
-checkit "$RSYNC -avv
R --exclude=\"$fromdir/foo/down\"
\
-
\"$fromdir/foo\" \"$todir\"
" "$chkdir$fromdir/foo" "$todir$fromdir/foo"
+checkit "$RSYNC -avv
$relative_opts --exclude='$fromdir/foo/down'
\
+
'$fromdir/foo' '$todir'
" "$chkdir$fromdir/foo" "$todir$fromdir/foo"
# The script would have aborted on error, so getting here means we've won.
exit 0
# The script would have aborted on error, so getting here means we've won.
exit 0