diff options
author | Joe Perches <joe@perches.com> | 2010-03-05 16:43:03 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-06 14:26:33 -0500 |
commit | 4b76c9da611593eed6a13527c5ebd00c173624ad (patch) | |
tree | 0d7d3a57949e087eb9fb1cceab5982ab6e9da6c8 | |
parent | 03372dbbe618bfcd02f9c8cdbfe78e97e3aad43b (diff) |
scripts/get_maintainer.pl: add --sections, print entire matched subsystem
Print the complete contents of the matched subsystems
in pattern match depth order.
Sample output:
$ ./scripts/get_maintainer.pl --sections -f drivers/net/usb/smsc95xx.c
USB SMSC95XX ETHERNET DRIVER
M:Steve Glendinning <steve.glendinning@smsc.com>
L:netdev@vger.kernel.org
S:Supported
F:drivers/net/usb/smsc95xx.*
USB SUBSYSTEM
M:Greg Kroah-Hartman <gregkh@suse.de>
L:linux-usb@vger.kernel.org
W:http://www.linux-usb.org
T:quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/
S:Supported
F:Documentation/usb/
F:drivers/net/usb/
F:drivers/usb/
F:include/linux/usb.h
F:include/linux/usb/
NETWORKING DRIVERS
L:netdev@vger.kernel.org
W:http://www.linuxfoundation.org/en/Net
T:git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.git
S:Odd Fixes
F:drivers/net/
F:include/linux/if_*
F:include/linux/*device.h
THE REST
M:Linus Torvalds <torvalds@linux-foundation.org>
L:linux-kernel@vger.kernel.org
Q:http://patchwork.kernel.org/project/LKML/list/
T:git git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
S:Buried alive in reporters
F:*
F:*/
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>
-rwxr-xr-x | scripts/get_maintainer.pl | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index bff2390652c2..e54f72f6c341 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl | |||
@@ -41,6 +41,7 @@ my $web = 0; | |||
41 | my $subsystem = 0; | 41 | my $subsystem = 0; |
42 | my $status = 0; | 42 | my $status = 0; |
43 | my $keywords = 1; | 43 | my $keywords = 1; |
44 | my $sections = 0; | ||
44 | my $file_emails = 0; | 45 | my $file_emails = 0; |
45 | my $from_filename = 0; | 46 | my $from_filename = 0; |
46 | my $pattern_depth = 0; | 47 | my $pattern_depth = 0; |
@@ -121,6 +122,7 @@ if (!GetOptions( | |||
121 | 'web!' => \$web, | 122 | 'web!' => \$web, |
122 | 'pattern-depth=i' => \$pattern_depth, | 123 | 'pattern-depth=i' => \$pattern_depth, |
123 | 'k|keywords!' => \$keywords, | 124 | 'k|keywords!' => \$keywords, |
125 | 'sections!' => \$sections, | ||
124 | 'fe|file-emails!' => \$file_emails, | 126 | 'fe|file-emails!' => \$file_emails, |
125 | 'f|file' => \$from_filename, | 127 | 'f|file' => \$from_filename, |
126 | 'v|version' => \$version, | 128 | 'v|version' => \$version, |
@@ -152,10 +154,20 @@ if ($output_rolestats) { | |||
152 | $output_roles = 1; | 154 | $output_roles = 1; |
153 | } | 155 | } |
154 | 156 | ||
155 | my $selections = $email + $scm + $status + $subsystem + $web; | 157 | if ($sections) { |
156 | if ($selections == 0) { | 158 | $email = 0; |
157 | usage(); | 159 | $email_list = 0; |
158 | die "$P: Missing required option: email, scm, status, subsystem or web\n"; | 160 | $scm = 0; |
161 | $status = 0; | ||
162 | $subsystem = 0; | ||
163 | $web = 0; | ||
164 | $keywords = 0; | ||
165 | } else { | ||
166 | my $selections = $email + $scm + $status + $subsystem + $web; | ||
167 | if ($selections == 0) { | ||
168 | usage(); | ||
169 | die "$P: Missing required option: email, scm, status, subsystem or web\n"; | ||
170 | } | ||
159 | } | 171 | } |
160 | 172 | ||
161 | if ($email && | 173 | if ($email && |
@@ -357,6 +369,21 @@ foreach my $file (@files) { | |||
357 | 369 | ||
358 | foreach my $line (sort {$hash{$b} <=> $hash{$a}} keys %hash) { | 370 | foreach my $line (sort {$hash{$b} <=> $hash{$a}} keys %hash) { |
359 | add_categories($line); | 371 | add_categories($line); |
372 | if ($sections) { | ||
373 | my $i; | ||
374 | my $start = find_starting_index($line); | ||
375 | my $end = find_ending_index($line); | ||
376 | for ($i = $start; $i < $end; $i++) { | ||
377 | my $line = $typevalue[$i]; | ||
378 | if ($line =~ /^[FX]:/) { ##Restore file patterns | ||
379 | $line =~ s/([^\\])\.([^\*])/$1\?$2/g; | ||
380 | $line =~ s/([^\\])\.$/$1\?/g; ##Convert . back to ? | ||
381 | $line =~ s/\\\./\./g; ##Convert \. to . | ||
382 | $line =~ s/\.\*/\*/g; ##Convert .* to * | ||
383 | } | ||
384 | print("$line\n"); | ||
385 | } | ||
386 | } | ||
360 | } | 387 | } |
361 | 388 | ||
362 | if ($email && $email_git) { | 389 | if ($email && $email_git) { |
@@ -486,6 +513,7 @@ Output type options: | |||
486 | Other options: | 513 | Other options: |
487 | --pattern-depth => Number of pattern directory traversals (default: 0 (all)) | 514 | --pattern-depth => Number of pattern directory traversals (default: 0 (all)) |
488 | --keywords => scan patch for keywords (default: 1 (on)) | 515 | --keywords => scan patch for keywords (default: 1 (on)) |
516 | --sections => print the entire subsystem sections with pattern matches | ||
489 | --version => show version | 517 | --version => show version |
490 | --help => show this help information | 518 | --help => show this help information |
491 | 519 | ||