The Samba-Bugzilla – Bug 10621
Allow Filter Rule Imports Relative to Importer
Last modified: 2014-05-21 07:39:36 UTC
Okay, so currently when forming an import rule to add filters to a sync, rsync only supports either a path local to the source directory, or a system level absolute path.
For example, say I have filter rules located at:
If I wanted Mac.rules to include the contents of Common.rules I would need to add a rule like so:
This is because a local rule won't work, i.e:
What I would like to propose is a new option for the import rule that tells rsync to lookup the path relative to whatever is importing it. If this is a file then it will be the file's parent directory, while if it is a --filter option for an rsync command, then this will be relative to the current working directory.
This ought to make it easier to work with modular filter rules that are broken down by various criteria, rather than bundled together into one huge file. In the above example, I could also add a Windows.rules file, and a Linux.rules file and so-on, as these would allow me to easily change the rules I use to account for common files on different OSes.