diff options
-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 | ||