Fixed an "Internal abbrev error" when dealing with an xattr value
[rsync/rsync.git] / testsuite / exclude.test
index 9337560..2fef092 100644 (file)
@@ -5,7 +5,7 @@
 # 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.
@@ -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"
-ln -s too "$fromdir/bar/down/to/foo/sym"
 
 # Setup our test exclude/include files.
 
@@ -106,12 +105,17 @@ cat >"$scratchdir/.cvsignore" <<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.
-
 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.
 
-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.
 
@@ -142,8 +146,8 @@ $RSYNC -av --existing --filter='exclude,! */' "$fromdir/" "$chkdir/"
 # 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.
 
@@ -162,9 +166,9 @@ $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_- \
-    --delete-during \"$fromdir/\" \"$todir/\"" "$chkdir" "$todir"
+    --delete-during '$fromdir/' '$todir/'" "$chkdir" "$todir"
 
 # 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.
 
-checkit "sed '/!/d' \"$excl\" |
+checkit "sed '/!/d' '$excl' |
     $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.
 
@@ -201,14 +205,15 @@ $RSYNC -av --existing --filter='-! */' "$fromdir/" "$chkdir/"
 $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"
-$RSYNC -avR --existing --filter='-! */' "$fromdir/foo" "$chkdir/"
+$RSYNC -av $relative_opts --existing --filter='-! */' "$fromdir/foo" "$chkdir/"
 
-checkit "$RSYNC -avvR --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