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