History

scripts/get_maintainer.pl: support both "P:/M:" and integrated "M:" lines

Joe Perches committed 17 years ago

Commit 5f2441e1 parent d7895041 file · +22 −8Browse files

Unified · Split

scripts/get_maintainer.pl+22−8
@@ -55,7 +55,7 @@ foreach my $chief (@penguin_chief) { · 54 unmodified lines
55}55}
56my $penguin_chiefs = "\(" . join("|",@penguin_chief_names) . "\)";56my $penguin_chiefs = "\(" . join("|",@penguin_chief_names) . "\)";
57 57
58# rfc822 - preloaded methods go here.58# rfc822 email address - preloaded methods go here.
59my $rfc822_lwsp = "(?:(?:\\r\\n)?[ \\t])";59my $rfc822_lwsp = "(?:(?:\\r\\n)?[ \\t])";
60my $rfc822_char = '[\\000-\\177]';60my $rfc822_char = '[\\000-\\177]';
61 61
@@ -396,7 +396,19 @@ sub add_categories { · 334 unmodified lines
396 }396 }
397 }397 }
398 } elsif ($ptype eq "M") {398 } elsif ($ptype eq "M") {
399 if ($email_maintainer) {399 my $p_used = 0;
400 if ($index >= 0) {
401 my $tv = $typevalue[$index - 1];
402 if ($tv =~ m/^(\C):\s*(.*)/) {
403 if ($1 eq "P") {
404 if ($email_usename) {
405 push_email_address(format_email($2, $pvalue));
406 $p_used = 1;
407 }
408 }
409 }
410 }
411 if (!$p_used) {
400 push_email_addresses($pvalue);412 push_email_addresses($pvalue);
401 }413 }
402 } elsif ($ptype eq "T") {414 } elsif ($ptype eq "T") {
@@ -436,13 +448,16 @@ sub push_email_addresses { · 33 unmodified lines
436 448
437 my @address_list = ();449 my @address_list = ();
438 450
439 if (@address_list = rfc822_validlist($address)) {451 if (rfc822_valid($address)) {
452 push_email_address($address);
453 } elsif (@address_list = rfc822_validlist($address)) {
440 my $array_count = shift(@address_list);454 my $array_count = shift(@address_list);
441 while (my $entry = shift(@address_list)) {455 while (my $entry = shift(@address_list)) {
442 push_email_address($entry);456 push_email_address($entry);
443 }457 }
458 } else {
459 warn("Invalid MAINTAINERS address: '" . $address . "'\n");
444 }460 }
445
446}461}
447 462
448sub which {463sub which {
@@ -471,9 +486,8 @@ sub recent_git_signoffs { · 22 unmodified lines
471 return;486 return;
472 }487 }
473 if (!(-d ".git")) {488 if (!(-d ".git")) {
474 warn("$P: .git repository not found.\n");489 warn("$P: .git directory not found. Use a git repository for better results.\n");
475 warn("Use a .git repository for better results.\n");490 warn("$P: perhaps 'git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git'\n");
476 warn("ie: git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git\n");
477 return;491 return;
478 }492 }
479 493
@@ -632,7 +646,7 @@ sub rfc822_validlist ($) { · 152 unmodified lines
632 my @r;646 my @r;
633 if ($s =~ m/^(?:$rfc822re)?(?:,(?:$rfc822re)?)*$/so &&647 if ($s =~ m/^(?:$rfc822re)?(?:,(?:$rfc822re)?)*$/so &&
634 $s =~ m/^$rfc822_char*$/) {648 $s =~ m/^$rfc822_char*$/) {
635 while($s =~ m/(?:^|,$rfc822_lwsp*)($rfc822re)/gos) {649 while ($s =~ m/(?:^|,$rfc822_lwsp*)($rfc822re)/gos) {
636 push @r, $1;650 push @r, $1;
637 }651 }
638 return wantarray ? (scalar(@r), @r) : 1;652 return wantarray ? (scalar(@r), @r) : 1;