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
5555 }
5656 my $penguin_chiefs = "\(" . join("|",@penguin_chief_names) . "\)";
5757
58−# rfc822 - preloaded methods go here.
58+# rfc822 email address - preloaded methods go here.
5959 my $rfc822_lwsp = "(?:(?:\\r\\n)?[ \\t])";
6060 my $rfc822_char = '[\\000-\\177]';
6161
@@ -396,7 +396,19 @@ sub add_categories { · 334 unmodified lines
396396 }
397397 }
398398 } 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) {
400412 push_email_addresses($pvalue);
401413 }
402414 } elsif ($ptype eq "T") {
@@ -436,13 +448,16 @@ sub push_email_addresses { · 33 unmodified lines
436448
437449 my @address_list = ();
438450
439− if (@address_list = rfc822_validlist($address)) {
451+ if (rfc822_valid($address)) {
452+ push_email_address($address);
453+ } elsif (@address_list = rfc822_validlist($address)) {
440454 my $array_count = shift(@address_list);
441455 while (my $entry = shift(@address_list)) {
442456 push_email_address($entry);
443457 }
458+ } else {
459+ warn("Invalid MAINTAINERS address: '" . $address . "'\n");
444460 }
445−
446461 }
447462
448463 sub which {
@@ -471,9 +486,8 @@ sub recent_git_signoffs { · 22 unmodified lines
471486 return;
472487 }
473488 if (!(-d ".git")) {
474− warn("$P: .git repository not found.\n");
475− warn("Use a .git repository for better results.\n");
476− warn("ie: git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git\n");
489+ warn("$P: .git directory not found. 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");
477491 return;
478492 }
479493
@@ -632,7 +646,7 @@ sub rfc822_validlist ($) { · 152 unmodified lines
632646 my @r;
633647 if ($s =~ m/^(?:$rfc822re)?(?:,(?:$rfc822re)?)*$/so &&
634648 $s =~ m/^$rfc822_char*$/) {
635− while($s =~ m/(?:^|,$rfc822_lwsp*)($rfc822re)/gos) {
649+ while ($s =~ m/(?:^|,$rfc822_lwsp*)($rfc822re)/gos) {
636650 push @r, $1;
637651 }
638652 return wantarray ? (scalar(@r), @r) : 1;