Fixing some exclude/include bugs

Wayne Davison wayned at samba.org
Wed Apr 23 04:48:57 EST 2003


As threatened a while back, there are some exclude/include bugs that I'd
like to see fixed in rsync.  Here is the patch:

    http://www.blorf.net/rsync-exclude.patch

This fixes the following bugs:

 - A non-anchored, slash-including pattern with a wildcard needs to be
   matched at the end of the path (e.g. "CVS/R* should match throughout
   the tree, not just at /CVS/R*).

 - A leading "**/" should match at the root of the transferred tree
   (e.g. "**/foo" should also match "/foo").

 - A path that includes an infix or trailing "**" but no slash should
   match the entire path, not just the trailing name (e.g. "foo**bar"
   should match "/some/foo/bar").  The docs need to mention this.

The remaining bug I didn't fix (yet):

 - The presence of a "**" turns all "*"s into "**"s.

Fixing this last bug would require either switching to a new wildcard-
matching routine (like the one I posted a while back), or switching to
using regular-expression matching and converting wildcard strings into
regex strings.  I'm thinking that it might be nice to go the regex route
and add an option to allow the user to specify all exclude/include
strings as regular expressions instead of wildcard strings.

Comments?

..wayne..


More information about the rsync mailing list