diff options
Diffstat (limited to 'scripts/get_maintainer.pl')
-rwxr-xr-x | scripts/get_maintainer.pl | 45 |
1 files changed, 41 insertions, 4 deletions
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index d21ec3a8960..139e0fff8e3 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.26-beta6'; | 16 | my $V = '0.26'; |
17 | 17 | ||
18 | use Getopt::Long qw(:config no_auto_abbrev); | 18 | use Getopt::Long qw(:config no_auto_abbrev); |
19 | 19 | ||
@@ -40,7 +40,7 @@ my $email_use_mailmap = 1; | |||
40 | my $output_multiline = 1; | 40 | my $output_multiline = 1; |
41 | my $output_separator = ", "; | 41 | my $output_separator = ", "; |
42 | my $output_roles = 0; | 42 | my $output_roles = 0; |
43 | my $output_rolestats = 0; | 43 | my $output_rolestats = 1; |
44 | my $scm = 0; | 44 | my $scm = 0; |
45 | my $web = 0; | 45 | my $web = 0; |
46 | my $subsystem = 0; | 46 | my $subsystem = 0; |
@@ -494,6 +494,40 @@ if ($web) { | |||
494 | 494 | ||
495 | exit($exit); | 495 | exit($exit); |
496 | 496 | ||
497 | sub range_is_maintained { | ||
498 | my ($start, $end) = @_; | ||
499 | |||
500 | for (my $i = $start; $i < $end; $i++) { | ||
501 | my $line = $typevalue[$i]; | ||
502 | if ($line =~ m/^(\C):\s*(.*)/) { | ||
503 | my $type = $1; | ||
504 | my $value = $2; | ||
505 | if ($type eq 'S') { | ||
506 | if ($value =~ /(maintain|support)/i) { | ||
507 | return 1; | ||
508 | } | ||
509 | } | ||
510 | } | ||
511 | } | ||
512 | return 0; | ||
513 | } | ||
514 | |||
515 | sub range_has_maintainer { | ||
516 | my ($start, $end) = @_; | ||
517 | |||
518 | for (my $i = $start; $i < $end; $i++) { | ||
519 | my $line = $typevalue[$i]; | ||
520 | if ($line =~ m/^(\C):\s*(.*)/) { | ||
521 | my $type = $1; | ||
522 | my $value = $2; | ||
523 | if ($type eq 'M') { | ||
524 | return 1; | ||
525 | } | ||
526 | } | ||
527 | } | ||
528 | return 0; | ||
529 | } | ||
530 | |||
497 | sub get_maintainers { | 531 | sub get_maintainers { |
498 | %email_hash_name = (); | 532 | %email_hash_name = (); |
499 | %email_hash_address = (); | 533 | %email_hash_address = (); |
@@ -556,7 +590,9 @@ sub get_maintainers { | |||
556 | my $file_pd = ($file =~ tr@/@@); | 590 | my $file_pd = ($file =~ tr@/@@); |
557 | $value_pd++ if (substr($value,-1,1) ne "/"); | 591 | $value_pd++ if (substr($value,-1,1) ne "/"); |
558 | $value_pd = -1 if ($value =~ /^\.\*/); | 592 | $value_pd = -1 if ($value =~ /^\.\*/); |
559 | if ($value_pd >= $file_pd) { | 593 | if ($value_pd >= $file_pd && |
594 | range_is_maintained($start, $end) && | ||
595 | range_has_maintainer($start, $end)) { | ||
560 | $exact_pattern_match_hash{$file} = 1; | 596 | $exact_pattern_match_hash{$file} = 1; |
561 | } | 597 | } |
562 | if ($pattern_depth == 0 || | 598 | if ($pattern_depth == 0 || |
@@ -720,7 +756,8 @@ Other options: | |||
720 | --help => show this help information | 756 | --help => show this help information |
721 | 757 | ||
722 | Default options: | 758 | Default options: |
723 | [--email --git --m --n --l --multiline --pattern-depth=0 --remove-duplicates] | 759 | [--email --nogit --git-fallback --m --n --l --multiline -pattern-depth=0 |
760 | --remove-duplicates --rolestats] | ||
724 | 761 | ||
725 | Notes: | 762 | Notes: |
726 | Using "-f directory" may give unexpected results: | 763 | Using "-f directory" may give unexpected results: |