diff options
author | Joe Perches <joe@perches.com> | 2009-07-29 18:04:28 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-07-29 22:10:40 -0400 |
commit | 870020f93af2323a81f179091a0780dc1d5b916b (patch) | |
tree | 71b88800d4d0cdcd13369a44ab125f9f5a0d372f /scripts/get_maintainer.pl | |
parent | 82c4dfc76200055bd2ae600a08404c10df5f4ff6 (diff) |
scripts/get_maintainer.pl: Add -f directory use
Don't require a specific file in a directory to be tested.
Also Arnd Bergmann pointed out that the MAINTAINERS pattern requirement
that directory patterns have a trailing slash was unnecessary and was
likely to be error prone. Removed that requirement.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/get_maintainer.pl')
-rwxr-xr-x | scripts/get_maintainer.pl | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index 3e733146cd51..7fc09fc91e8b 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl | |||
@@ -13,7 +13,7 @@ | |||
13 | use strict; | 13 | use strict; |
14 | 14 | ||
15 | my $P = $0; | 15 | my $P = $0; |
16 | my $V = '0.16'; | 16 | my $V = '0.17'; |
17 | 17 | ||
18 | use Getopt::Long qw(:config no_auto_abbrev); | 18 | use Getopt::Long qw(:config no_auto_abbrev); |
19 | 19 | ||
@@ -132,6 +132,10 @@ while (<MAINT>) { | |||
132 | $value =~ s@\.@\\\.@g; ##Convert . to \. | 132 | $value =~ s@\.@\\\.@g; ##Convert . to \. |
133 | $value =~ s/\*/\.\*/g; ##Convert * to .* | 133 | $value =~ s/\*/\.\*/g; ##Convert * to .* |
134 | $value =~ s/\?/\./g; ##Convert ? to . | 134 | $value =~ s/\?/\./g; ##Convert ? to . |
135 | ##if pattern is a directory and it lacks a trailing slash, add one | ||
136 | if ((-d $value)) { | ||
137 | $value =~ s@([^/])$@$1/@; | ||
138 | } | ||
135 | } | 139 | } |
136 | push(@typevalue, "$type:$value"); | 140 | push(@typevalue, "$type:$value"); |
137 | } elsif (!/^(\s)*$/) { | 141 | } elsif (!/^(\s)*$/) { |
@@ -146,8 +150,10 @@ close(MAINT); | |||
146 | my @files = (); | 150 | my @files = (); |
147 | 151 | ||
148 | foreach my $file (@ARGV) { | 152 | foreach my $file (@ARGV) { |
149 | next if ((-d $file)); | 153 | ##if $file is a directory and it lacks a trailing slash, add one |
150 | if (!(-f $file)) { | 154 | if ((-d $file)) { |
155 | $file =~ s@([^/])$@$1/@; | ||
156 | } elsif (!(-f $file)) { | ||
151 | die "$P: file '${file}' not found\n"; | 157 | die "$P: file '${file}' not found\n"; |
152 | } | 158 | } |
153 | if ($from_filename) { | 159 | if ($from_filename) { |
@@ -292,7 +298,7 @@ sub file_match_pattern { | |||
292 | sub usage { | 298 | sub usage { |
293 | print <<EOT; | 299 | print <<EOT; |
294 | usage: $P [options] patchfile | 300 | usage: $P [options] patchfile |
295 | $P [options] -f file | 301 | $P [options] -f file|directory |
296 | version: $V | 302 | version: $V |
297 | 303 | ||
298 | MAINTAINER field selection options: | 304 | MAINTAINER field selection options: |
@@ -322,6 +328,15 @@ Other options: | |||
322 | --version => show version | 328 | --version => show version |
323 | --help => show this help information | 329 | --help => show this help information |
324 | 330 | ||
331 | Notes: | ||
332 | Using "-f directory" may give unexpected results: | ||
333 | |||
334 | Used with "--git", git signators for _all_ files in and below | ||
335 | directory are examined as git recurses directories. | ||
336 | Any specified X: (exclude) pattern matches are _not_ ignored. | ||
337 | Used with "--nogit", directory is used as a pattern match, | ||
338 | no individual file within the directory or subdirectory | ||
339 | is matched. | ||
325 | EOT | 340 | EOT |
326 | } | 341 | } |
327 | 342 | ||