X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/90d5b12e7278a2bb9b01da4f18884e325e940696..44ae54114ac29ebe6bff34f98e59e51d3cb71a40:/testsuite/exclude.test diff --git a/testsuite/exclude.test b/testsuite/exclude.test index 09c0e799..099344f2 100644 --- a/testsuite/exclude.test +++ b/testsuite/exclude.test @@ -2,21 +2,18 @@ # Copyright (C) 2003, 2004, 2005 by 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). -# 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. . "$suitedir/rsync.fns" -HOME="$scratchdir" CVSIGNORE='*.junk' -export HOME CVSIGNORE - -set -x +export CVSIGNORE # Build some files/dirs/links to copy @@ -79,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. @@ -109,12 +105,17 @@ cat >"$scratchdir/.cvsignore" <"$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. -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. @@ -183,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. @@ -204,7 +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" + +relative_opts='--relative --chmod=Du+w --copy-unsafe-links' +$RSYNC -av $relative_opts "$fromdir/foo" "$chkdir/" +rm -rf "$chkdir$fromdir/foo/down" +$RSYNC -av $relative_opts --existing --filter='-! */' "$fromdir/foo" "$chkdir/" + +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