diff options
author | Joe Perches <joe@perches.com> | 2009-09-21 20:04:24 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-22 10:17:46 -0400 |
commit | b781655a6f6d15bdcc96f2cc1d56b0658f9cf0b4 (patch) | |
tree | b2b2b1f0cc825333160b929aa48546b587cc4ace /scripts | |
parent | 11ecf53c97863a0609db3816d82f1d0ddf3d2bc2 (diff) |
scripts/get_maintainer.pl: add maintainers in order listed in matched section
Previous behavior was "bottom-up" in each section from the pattern "F:"
entry that matched. Now information is entered into the various lists in
the "as entered" order for each matched section.
This also allows the F: entry to be put anywhere in a section, not just as
the last entries in the section.
And a couple of improvements:
Don't alphabetically sort before outputting the matched scm, status,
subsystem and web sections.
Ignore content after a single email address so these entries are acceptable
M: name <address> whatever other comment
And a fix:
Make an M: entry without a name again use the name from an immediately
preceding P: line if it exists.
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>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/get_maintainer.pl | 70 |
1 files changed, 54 insertions, 16 deletions
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index 473b6741d55f..cdb44b63342e 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl | |||
@@ -313,22 +313,22 @@ if ($email || $email_list) { | |||
313 | } | 313 | } |
314 | 314 | ||
315 | if ($scm) { | 315 | if ($scm) { |
316 | @scm = sort_and_uniq(@scm); | 316 | @scm = uniq(@scm); |
317 | output(@scm); | 317 | output(@scm); |
318 | } | 318 | } |
319 | 319 | ||
320 | if ($status) { | 320 | if ($status) { |
321 | @status = sort_and_uniq(@status); | 321 | @status = uniq(@status); |
322 | output(@status); | 322 | output(@status); |
323 | } | 323 | } |
324 | 324 | ||
325 | if ($subsystem) { | 325 | if ($subsystem) { |
326 | @subsystem = sort_and_uniq(@subsystem); | 326 | @subsystem = uniq(@subsystem); |
327 | output(@subsystem); | 327 | output(@subsystem); |
328 | } | 328 | } |
329 | 329 | ||
330 | if ($web) { | 330 | if ($web) { |
331 | @web = sort_and_uniq(@web); | 331 | @web = uniq(@web); |
332 | output(@web); | 332 | output(@web); |
333 | } | 333 | } |
334 | 334 | ||
@@ -442,7 +442,7 @@ sub parse_email { | |||
442 | $address = $2; | 442 | $address = $2; |
443 | } elsif ($formatted_email =~ /^\s*<(.+\@\S*)>.*$/) { | 443 | } elsif ($formatted_email =~ /^\s*<(.+\@\S*)>.*$/) { |
444 | $address = $1; | 444 | $address = $1; |
445 | } elsif ($formatted_email =~ /^(.+\@\S*)$/) { | 445 | } elsif ($formatted_email =~ /^(.+\@\S*).*$/) { |
446 | $address = $1; | 446 | $address = $1; |
447 | } | 447 | } |
448 | 448 | ||
@@ -485,12 +485,46 @@ sub format_email { | |||
485 | return $formatted_email; | 485 | return $formatted_email; |
486 | } | 486 | } |
487 | 487 | ||
488 | sub add_categories { | 488 | sub find_starting_index { |
489 | |||
490 | my ($index) = @_; | ||
491 | |||
492 | while ($index > 0) { | ||
493 | my $tv = $typevalue[$index]; | ||
494 | if (!($tv =~ m/^(\C):\s*(.*)/)) { | ||
495 | last; | ||
496 | } | ||
497 | $index--; | ||
498 | } | ||
499 | |||
500 | return $index; | ||
501 | } | ||
502 | |||
503 | sub find_ending_index { | ||
489 | my ($index) = @_; | 504 | my ($index) = @_; |
490 | 505 | ||
491 | $index = $index - 1; | 506 | while ($index < @typevalue) { |
492 | while ($index >= 0) { | ||
493 | my $tv = $typevalue[$index]; | 507 | my $tv = $typevalue[$index]; |
508 | if (!($tv =~ m/^(\C):\s*(.*)/)) { | ||
509 | last; | ||
510 | } | ||
511 | $index++; | ||
512 | } | ||
513 | |||
514 | return $index; | ||
515 | } | ||
516 | |||
517 | sub add_categories { | ||
518 | my ($index) = @_; | ||
519 | |||
520 | my $i; | ||
521 | my $start = find_starting_index($index); | ||
522 | my $end = find_ending_index($index); | ||
523 | |||
524 | push(@subsystem, $typevalue[$start]); | ||
525 | |||
526 | for ($i = $start + 1; $i < $end; $i++) { | ||
527 | my $tv = $typevalue[$i]; | ||
494 | if ($tv =~ m/^(\C):\s*(.*)/) { | 528 | if ($tv =~ m/^(\C):\s*(.*)/) { |
495 | my $ptype = $1; | 529 | my $ptype = $1; |
496 | my $pvalue = $2; | 530 | my $pvalue = $2; |
@@ -513,11 +547,12 @@ sub add_categories { | |||
513 | } elsif ($ptype eq "M") { | 547 | } elsif ($ptype eq "M") { |
514 | my ($name, $address) = parse_email($pvalue); | 548 | my ($name, $address) = parse_email($pvalue); |
515 | if ($name eq "") { | 549 | if ($name eq "") { |
516 | if ($index >= 0) { | 550 | if ($i > 0) { |
517 | my $tv = $typevalue[$index - 1]; | 551 | my $tv = $typevalue[$i - 1]; |
518 | if ($tv =~ m/^(\C):\s*(.*)/) { | 552 | if ($tv =~ m/^(\C):\s*(.*)/) { |
519 | if ($1 eq "P") { | 553 | if ($1 eq "P") { |
520 | $name = $2; | 554 | $name = $2; |
555 | $pvalue = format_email($name, $address); | ||
521 | } | 556 | } |
522 | } | 557 | } |
523 | } | 558 | } |
@@ -532,11 +567,6 @@ sub add_categories { | |||
532 | } elsif ($ptype eq "S") { | 567 | } elsif ($ptype eq "S") { |
533 | push(@status, $pvalue); | 568 | push(@status, $pvalue); |
534 | } | 569 | } |
535 | |||
536 | $index--; | ||
537 | } else { | ||
538 | push(@subsystem,$tv); | ||
539 | $index = -1; | ||
540 | } | 570 | } |
541 | } | 571 | } |
542 | } | 572 | } |
@@ -559,6 +589,10 @@ sub push_email_address { | |||
559 | 589 | ||
560 | my ($name, $address) = parse_email($line); | 590 | my ($name, $address) = parse_email($line); |
561 | 591 | ||
592 | if ($address eq "") { | ||
593 | return 0; | ||
594 | } | ||
595 | |||
562 | if (!$email_remove_duplicates) { | 596 | if (!$email_remove_duplicates) { |
563 | push(@email_to, format_email($name, $address)); | 597 | push(@email_to, format_email($name, $address)); |
564 | } elsif (!email_inuse($name, $address)) { | 598 | } elsif (!email_inuse($name, $address)) { |
@@ -566,6 +600,8 @@ sub push_email_address { | |||
566 | $email_hash_name{$name}++; | 600 | $email_hash_name{$name}++; |
567 | $email_hash_address{$address}++; | 601 | $email_hash_address{$address}++; |
568 | } | 602 | } |
603 | |||
604 | return 1; | ||
569 | } | 605 | } |
570 | 606 | ||
571 | sub push_email_addresses { | 607 | sub push_email_addresses { |
@@ -581,7 +617,9 @@ sub push_email_addresses { | |||
581 | push_email_address($entry); | 617 | push_email_address($entry); |
582 | } | 618 | } |
583 | } else { | 619 | } else { |
584 | warn("Invalid MAINTAINERS address: '" . $address . "'\n"); | 620 | if (!push_email_address($address)) { |
621 | warn("Invalid MAINTAINERS address: '" . $address . "'\n"); | ||
622 | } | ||
585 | } | 623 | } |
586 | } | 624 | } |
587 | 625 | ||