OpenBSD Journal

(open)rsync gains include/exclude support

Contributed by rueda on from the --enclusive, --ixclaudio dept.

Claudio Jeker (claudio@) has committed support for simple include and exclude cases in (open)rsync:

CVSROOT:	/cvs
Module name:	src
Changes by:	claudio@cvs.openbsd.org	2021/08/29 07:43:46

Modified files:
	usr.bin/rsync  : Makefile extern.h flist.c main.c receiver.c 
	                 sender.c 
Added files:
	usr.bin/rsync  : charclass.h rmatch.c rules.c 

Log message:
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

Great stuff! This should further reduce the need for installing the net/rsync port.

(Comments are closed)


Comments
  1. By grey (grey) on

    Nice!

    Albeit, the last time I was testing openrsync, I discovered I could use openrsync to reproducibly crash rsync on FreeBSD13-CURRENT on a Raspberry Pi 3 and decided rather than try to debug rsync, I would wait for openrsync to mature a bit, I'm grateful to see that it continues to progress!

Credits

Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original deadly.org with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]