Implement --exclude/exclude-file and --include/include-file.
authorclaudio <claudio@openbsd.org>
Sun, 29 Aug 2021 13:43:46 +0000 (13:43 +0000)
committerclaudio <claudio@openbsd.org>
Sun, 29 Aug 2021 13:43:46 +0000 (13:43 +0000)
commit57987d16c1d43216ef12961e336dd4f6644b16b9
tree96630497580f859d25836b219d06d80c33b9deb5
parentaf497a4f52bf094cd0d584b8d996a550400f0e4a
Implement --exclude/exclude-file and --include/include-file.
Currently only simple include and excludes work, the advanced filters
introduced later in rsync are not implemented. It is unclear if the per
directory filters are something we want to implement. This requires
more modern protocols which openrsync is not able to handle right now.

This adds a special matching function to allow the ** matching which behaves
mostly like rsyncs version with the exception of how bad [] patterns are
expanded. For bad patterns openrsync follows more how fnmatch behaves and
not the somewhat strange rsync behaviour.

Not perfect but committing now so people can test and provide feedback.
usr.bin/rsync/Makefile
usr.bin/rsync/charclass.h [new file with mode: 0644]
usr.bin/rsync/extern.h
usr.bin/rsync/flist.c
usr.bin/rsync/main.c
usr.bin/rsync/receiver.c
usr.bin/rsync/rmatch.c [new file with mode: 0644]
usr.bin/rsync/rules.c [new file with mode: 0644]
usr.bin/rsync/sender.c