diff options
-rwxr-xr-x | scripts/get_maintainer.pl | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index 60dc0c48c929..c4b25a7a2599 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.15'; | 16 | my $V = '0.16'; |
17 | 17 | ||
18 | use Getopt::Long qw(:config no_auto_abbrev); | 18 | use Getopt::Long qw(:config no_auto_abbrev); |
19 | 19 | ||
@@ -169,6 +169,7 @@ foreach my $file (@ARGV) { | |||
169 | } | 169 | } |
170 | 170 | ||
171 | my @email_to = (); | 171 | my @email_to = (); |
172 | my @list_to = (); | ||
172 | my @scm = (); | 173 | my @scm = (); |
173 | my @web = (); | 174 | my @web = (); |
174 | my @subsystem = (); | 175 | my @subsystem = (); |
@@ -182,7 +183,7 @@ foreach my $file (@files) { | |||
182 | 183 | ||
183 | my $exclude = 0; | 184 | my $exclude = 0; |
184 | foreach my $line (@typevalue) { | 185 | foreach my $line (@typevalue) { |
185 | if ($line =~ m/^(\C):(.*)/) { | 186 | if ($line =~ m/^(\C):\s*(.*)/) { |
186 | my $type = $1; | 187 | my $type = $1; |
187 | my $value = $2; | 188 | my $value = $2; |
188 | if ($type eq 'X') { | 189 | if ($type eq 'X') { |
@@ -196,7 +197,7 @@ foreach my $file (@files) { | |||
196 | if (!$exclude) { | 197 | if (!$exclude) { |
197 | my $tvi = 0; | 198 | my $tvi = 0; |
198 | foreach my $line (@typevalue) { | 199 | foreach my $line (@typevalue) { |
199 | if ($line =~ m/^(\C):(.*)/) { | 200 | if ($line =~ m/^(\C):\s*(.*)/) { |
200 | my $type = $1; | 201 | my $type = $1; |
201 | my $value = $2; | 202 | my $value = $2; |
202 | if ($type eq 'F') { | 203 | if ($type eq 'F') { |
@@ -229,15 +230,18 @@ if ($email_git_penguin_chiefs) { | |||
229 | } | 230 | } |
230 | } | 231 | } |
231 | 232 | ||
232 | if ($email) { | 233 | if ($email || $email_list) { |
233 | my $address_cnt = @email_to; | 234 | my @to = (); |
234 | if ($address_cnt == 0 && $email_list) { | 235 | if ($email) { |
235 | push(@email_to, "linux-kernel\@vger.kernel.org"); | 236 | @to = (@to, @email_to); |
236 | } | 237 | } |
237 | 238 | if ($email_list) { | |
238 | #Don't sort email address list, but do remove duplicates | 239 | if (@list_to == 0) { |
239 | @email_to = uniq(@email_to); | 240 | push(@list_to, "linux-kernel\@vger.kernel.org"); |
240 | output(@email_to); | 241 | @to = (@to, @list_to); |
242 | } | ||
243 | } | ||
244 | output(uniq(@to)); | ||
241 | } | 245 | } |
242 | 246 | ||
243 | if ($scm) { | 247 | if ($scm) { |
@@ -307,7 +311,7 @@ Output type options: | |||
307 | --multiline => print 1 entry per line | 311 | --multiline => print 1 entry per line |
308 | 312 | ||
309 | Default options: | 313 | Default options: |
310 | [--email --git --m --l --multiline] | 314 | [--email --git --m --n --l --multiline] |
311 | 315 | ||
312 | Other options: | 316 | Other options: |
313 | --version -> show version | 317 | --version -> show version |
@@ -366,26 +370,30 @@ sub add_categories { | |||
366 | $index = $index - 1; | 370 | $index = $index - 1; |
367 | while ($index >= 0) { | 371 | while ($index >= 0) { |
368 | my $tv = $typevalue[$index]; | 372 | my $tv = $typevalue[$index]; |
369 | if ($tv =~ m/^(\C):(.*)/) { | 373 | if ($tv =~ m/^(\C):\s*(.*)/) { |
370 | my $ptype = $1; | 374 | my $ptype = $1; |
371 | my $pvalue = $2; | 375 | my $pvalue = $2; |
372 | if ($ptype eq "L") { | 376 | if ($ptype eq "L") { |
373 | my $subscr = $pvalue; | 377 | my $list_address = $pvalue; |
374 | if ($subscr =~ m/\s*\(subscribers-only\)/) { | 378 | my $list_additional = ""; |
379 | if ($list_address =~ m/([^\s]+)\s+(.*)$/) { | ||
380 | $list_address = $1; | ||
381 | $list_additional = $2; | ||
382 | } | ||
383 | if ($list_additional =~ m/\(subscribers-only\)/) { | ||
375 | if ($email_subscriber_list) { | 384 | if ($email_subscriber_list) { |
376 | $subscr =~ s/\s*\(subscribers-only\)//g; | 385 | push(@list_to, $list_address); |
377 | push(@email_to, $subscr); | ||
378 | } | 386 | } |
379 | } else { | 387 | } else { |
380 | if ($email_list) { | 388 | if ($email_list) { |
381 | push(@email_to, $pvalue); | 389 | push(@list_to, $list_address); |
382 | } | 390 | } |
383 | } | 391 | } |
384 | } elsif ($ptype eq "M") { | 392 | } elsif ($ptype eq "M") { |
385 | if ($email_maintainer) { | 393 | if ($email_maintainer) { |
386 | if ($index >= 0) { | 394 | if ($index >= 0) { |
387 | my $tv = $typevalue[$index - 1]; | 395 | my $tv = $typevalue[$index - 1]; |
388 | if ($tv =~ m/^(\C):(.*)/) { | 396 | if ($tv =~ m/^(\C):\s*(.*)/) { |
389 | if ($1 eq "P" && $email_usename) { | 397 | if ($1 eq "P" && $email_usename) { |
390 | push(@email_to, format_email($2, $pvalue)); | 398 | push(@email_to, format_email($2, $pvalue)); |
391 | } else { | 399 | } else { |