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