Bug 10621 - Allow Filter Rule Imports Relative to Importer
Summary: Allow Filter Rule Imports Relative to Importer
Status: NEW
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 3.1.0
Hardware: All All
: P5 enhancement (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
Depends on:
Reported: 2014-05-21 07:39 UTC by Haravikk
Modified: 2014-05-21 07:39 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Haravikk 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:
. /Users/haravikk/FilterRules/Common.rules

This is because a local rule won't work, i.e:
. Common.rules

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.