Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 164517
b: refs/heads/master
c: b781655
h: refs/heads/master
i:
  164515: 45b0f25
v: v3
  • Loading branch information
Joe Perches authored and Linus Torvalds committed Sep 22, 2009
1 parent 6e5aa9f commit fb717ed
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 11ecf53c97863a0609db3816d82f1d0ddf3d2bc2
refs/heads/master: b781655a6f6d15bdcc96f2cc1d56b0658f9cf0b4
70 changes: 54 additions & 16 deletions trunk/scripts/get_maintainer.pl
Original file line number Diff line number Diff line change
Expand Up @@ -313,22 +313,22 @@
}

if ($scm) {
@scm = sort_and_uniq(@scm);
@scm = uniq(@scm);
output(@scm);
}

if ($status) {
@status = sort_and_uniq(@status);
@status = uniq(@status);
output(@status);
}

if ($subsystem) {
@subsystem = sort_and_uniq(@subsystem);
@subsystem = uniq(@subsystem);
output(@subsystem);
}

if ($web) {
@web = sort_and_uniq(@web);
@web = uniq(@web);
output(@web);
}

Expand Down Expand Up @@ -442,7 +442,7 @@ sub parse_email {
$address = $2;
} elsif ($formatted_email =~ /^\s*<(.+\@\S*)>.*$/) {
$address = $1;
} elsif ($formatted_email =~ /^(.+\@\S*)$/) {
} elsif ($formatted_email =~ /^(.+\@\S*).*$/) {
$address = $1;
}

Expand Down Expand Up @@ -485,12 +485,46 @@ sub format_email {
return $formatted_email;
}

sub add_categories {
sub find_starting_index {

my ($index) = @_;

while ($index > 0) {
my $tv = $typevalue[$index];
if (!($tv =~ m/^(\C):\s*(.*)/)) {
last;
}
$index--;
}

return $index;
}

sub find_ending_index {
my ($index) = @_;

$index = $index - 1;
while ($index >= 0) {
while ($index < @typevalue) {
my $tv = $typevalue[$index];
if (!($tv =~ m/^(\C):\s*(.*)/)) {
last;
}
$index++;
}

return $index;
}

sub add_categories {
my ($index) = @_;

my $i;
my $start = find_starting_index($index);
my $end = find_ending_index($index);

push(@subsystem, $typevalue[$start]);

for ($i = $start + 1; $i < $end; $i++) {
my $tv = $typevalue[$i];
if ($tv =~ m/^(\C):\s*(.*)/) {
my $ptype = $1;
my $pvalue = $2;
Expand All @@ -513,11 +547,12 @@ sub add_categories {
} elsif ($ptype eq "M") {
my ($name, $address) = parse_email($pvalue);
if ($name eq "") {
if ($index >= 0) {
my $tv = $typevalue[$index - 1];
if ($i > 0) {
my $tv = $typevalue[$i - 1];
if ($tv =~ m/^(\C):\s*(.*)/) {
if ($1 eq "P") {
$name = $2;
$pvalue = format_email($name, $address);
}
}
}
Expand All @@ -532,11 +567,6 @@ sub add_categories {
} elsif ($ptype eq "S") {
push(@status, $pvalue);
}

$index--;
} else {
push(@subsystem,$tv);
$index = -1;
}
}
}
Expand All @@ -559,13 +589,19 @@ sub push_email_address {

my ($name, $address) = parse_email($line);

if ($address eq "") {
return 0;
}

if (!$email_remove_duplicates) {
push(@email_to, format_email($name, $address));
} elsif (!email_inuse($name, $address)) {
push(@email_to, format_email($name, $address));
$email_hash_name{$name}++;
$email_hash_address{$address}++;
}

return 1;
}

sub push_email_addresses {
Expand All @@ -581,7 +617,9 @@ sub push_email_addresses {
push_email_address($entry);
}
} else {
warn("Invalid MAINTAINERS address: '" . $address . "'\n");
if (!push_email_address($address)) {
warn("Invalid MAINTAINERS address: '" . $address . "'\n");
}
}
}

Expand Down

0 comments on commit fb717ed

Please sign in to comment.