scripts/get_maintainer.pl: output first field only in mailing lists and after maintainers.

Fix mailing lists that are described, but not "(subscriber-only)"

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>
This commit is contained in:
Joe Perches 2009-06-16 15:33:58 -07:00 committed by Linus Torvalds
parent 8e8a2dea0c
commit 290603c120
1 changed files with 27 additions and 19 deletions

View File

@ -13,7 +13,7 @@
use strict; use strict;
my $P = $0; my $P = $0;
my $V = '0.15'; my $V = '0.16';
use Getopt::Long qw(:config no_auto_abbrev); use Getopt::Long qw(:config no_auto_abbrev);
@ -169,6 +169,7 @@ foreach my $file (@ARGV) {
} }
my @email_to = (); my @email_to = ();
my @list_to = ();
my @scm = (); my @scm = ();
my @web = (); my @web = ();
my @subsystem = (); my @subsystem = ();
@ -182,7 +183,7 @@ foreach my $file (@files) {
my $exclude = 0; my $exclude = 0;
foreach my $line (@typevalue) { foreach my $line (@typevalue) {
if ($line =~ m/^(\C):(.*)/) { if ($line =~ m/^(\C):\s*(.*)/) {
my $type = $1; my $type = $1;
my $value = $2; my $value = $2;
if ($type eq 'X') { if ($type eq 'X') {
@ -196,7 +197,7 @@ foreach my $file (@files) {
if (!$exclude) { if (!$exclude) {
my $tvi = 0; my $tvi = 0;
foreach my $line (@typevalue) { foreach my $line (@typevalue) {
if ($line =~ m/^(\C):(.*)/) { if ($line =~ m/^(\C):\s*(.*)/) {
my $type = $1; my $type = $1;
my $value = $2; my $value = $2;
if ($type eq 'F') { if ($type eq 'F') {
@ -229,15 +230,18 @@ if ($email_git_penguin_chiefs) {
} }
} }
if ($email) { if ($email || $email_list) {
my $address_cnt = @email_to; my @to = ();
if ($address_cnt == 0 && $email_list) { if ($email) {
push(@email_to, "linux-kernel\@vger.kernel.org"); @to = (@to, @email_to);
} }
if ($email_list) {
#Don't sort email address list, but do remove duplicates if (@list_to == 0) {
@email_to = uniq(@email_to); push(@list_to, "linux-kernel\@vger.kernel.org");
output(@email_to); @to = (@to, @list_to);
}
}
output(uniq(@to));
} }
if ($scm) { if ($scm) {
@ -307,7 +311,7 @@ Output type options:
--multiline => print 1 entry per line --multiline => print 1 entry per line
Default options: Default options:
[--email --git --m --l --multiline] [--email --git --m --n --l --multiline]
Other options: Other options:
--version -> show version --version -> show version
@ -366,26 +370,30 @@ sub add_categories {
$index = $index - 1; $index = $index - 1;
while ($index >= 0) { while ($index >= 0) {
my $tv = $typevalue[$index]; my $tv = $typevalue[$index];
if ($tv =~ m/^(\C):(.*)/) { if ($tv =~ m/^(\C):\s*(.*)/) {
my $ptype = $1; my $ptype = $1;
my $pvalue = $2; my $pvalue = $2;
if ($ptype eq "L") { if ($ptype eq "L") {
my $subscr = $pvalue; my $list_address = $pvalue;
if ($subscr =~ m/\s*\(subscribers-only\)/) { my $list_additional = "";
if ($list_address =~ m/([^\s]+)\s+(.*)$/) {
$list_address = $1;
$list_additional = $2;
}
if ($list_additional =~ m/\(subscribers-only\)/) {
if ($email_subscriber_list) { if ($email_subscriber_list) {
$subscr =~ s/\s*\(subscribers-only\)//g; push(@list_to, $list_address);
push(@email_to, $subscr);
} }
} else { } else {
if ($email_list) { if ($email_list) {
push(@email_to, $pvalue); push(@list_to, $list_address);
} }
} }
} elsif ($ptype eq "M") { } elsif ($ptype eq "M") {
if ($email_maintainer) { if ($email_maintainer) {
if ($index >= 0) { if ($index >= 0) {
my $tv = $typevalue[$index - 1]; my $tv = $typevalue[$index - 1];
if ($tv =~ m/^(\C):(.*)/) { if ($tv =~ m/^(\C):\s*(.*)/) {
if ($1 eq "P" && $email_usename) { if ($1 eq "P" && $email_usename) {
push(@email_to, format_email($2, $pvalue)); push(@email_to, format_email($2, $pvalue));
} else { } else {