The Samba-Bugzilla – Bug 7951
Option for case insensitivity in filter rules
Last modified: 2014-05-10 14:19:28 UTC
- Filter Rule: **.gif
- Plus an argument switch like: --filter-rules-case-insensitive
Result: matches all possible case permutations of .gif
- Filter Rule: **.[gG][iI][fF]
Remark: Not very user friendly, especially if you have a lot of filters.
No related bug in the tracker, I searched for all relevant keywords/permutations.
But the mailinglist mentions request + a patch:
When will this feature be implemented into the main product line?
The --ignore-case option of the "ignore-case.diff" maintained patch applies to filters. Is that what you want, or do you want case-insensitive filters on a case-sensitive run? If you tried the option and it did not work correctly, please provide steps to reproduce.
Rather than a command line switch which turns all filename comparisons case-insensitive (per --ignore-case from ignore-case.diff), or makes filter rules case-insensitive (per requested --filter-rules-case-insensitive), I'd prefer filter rules themselves come in case-sensitive and case-insensitive versions, e.g.:
# Exclude .gif files, but not .GIF
# Exclude .gif and .GIF (and .GiF etc) files
A use-case for this is on a case-sensitive filesystem where you do care about case sensitivity in file names (i.e. --ignore-case
isn't appropriate), but you want to filter all case permutations in some cases but not others (i.e. --filter-rules-case-insensitive would be inappropriate).
It would be fine if case-sensitivity could be both set by a switch in a filter file line (for fine granularity control as suggested by Chris Dunlop) and as a command line switch, which applies to all filter rules (catch all as mentioned by Matt McCutchen).
I'd just like to say that I'd also prefer the implementation proposed by Chris Dunlop; an i flag on filter rules would be a lot more flexible.
I recently encountered the problem with this when trying to add a rule for deleting temporary folders (*/tmp/, */temp/ etc.) and using classes is a really horrible workaround.