Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 178938
b: refs/heads/master
c: 272a897
h: refs/heads/master
v: v3
  • Loading branch information
Joe Perches authored and Linus Torvalds committed Jan 11, 2010
1 parent bbbb813 commit 9a9a182
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 31 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: 7ee3aebe31d2cb22c84e1c8f48182947b13a3607
refs/heads/master: 272a897904b9a067550f5b8e812036b65180418f
84 changes: 54 additions & 30 deletions trunk/scripts/get_maintainer.pl
Original file line number Diff line number Diff line change
Expand Up @@ -296,46 +296,56 @@

foreach my $file (@files) {

#Do not match excluded file patterns

my $exclude = 0;
foreach my $line (@typevalue) {
if ($line =~ m/^(\C):\s*(.*)/) {
my $type = $1;
my $value = $2;
if ($type eq 'X') {
if (file_match_pattern($file, $value)) {
$exclude = 1;
last;
}
}
}
}
my %hash;
my $tvi = find_first_section();
while ($tvi < @typevalue) {
my $start = find_starting_index($tvi);
my $end = find_ending_index($tvi);
my $exclude = 0;
my $i;

#Do not match excluded file patterns

if (!$exclude) {
my $tvi = 0;
my %hash;
foreach my $line (@typevalue) {
for ($i = $start; $i < $end; $i++) {
my $line = $typevalue[$i];
if ($line =~ m/^(\C):\s*(.*)/) {
my $type = $1;
my $value = $2;
if ($type eq 'F') {
if ($type eq 'X') {
if (file_match_pattern($file, $value)) {
my $value_pd = ($value =~ tr@/@@);
my $file_pd = ($file =~ tr@/@@);
$value_pd++ if (substr($value,-1,1) ne "/");
if ($pattern_depth == 0 ||
(($file_pd - $value_pd) < $pattern_depth)) {
$hash{$tvi} = $value_pd;
}
$exclude = 1;
}
}
}
$tvi++;
}
foreach my $line (sort {$hash{$b} <=> $hash{$a}} keys %hash) {
add_categories($line);

if (!$exclude) {
for ($i = $start; $i < $end; $i++) {
my $line = $typevalue[$i];
if ($line =~ m/^(\C):\s*(.*)/) {
my $type = $1;
my $value = $2;
if ($type eq 'F') {
if (file_match_pattern($file, $value)) {
my $value_pd = ($value =~ tr@/@@);
my $file_pd = ($file =~ tr@/@@);
$value_pd++ if (substr($value,-1,1) ne "/");
if ($pattern_depth == 0 ||
(($file_pd - $value_pd) < $pattern_depth)) {
$hash{$tvi} = $value_pd;
}
}
}
}
}
}

$tvi += ($end - $start);

}

foreach my $line (sort {$hash{$b} <=> $hash{$a}} keys %hash) {
add_categories($line);
}

if ($email && $email_git) {
Expand Down Expand Up @@ -570,6 +580,20 @@ sub format_email {
return $formatted_email;
}

sub find_first_section {
my $index = 0;

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

return $index;
}

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

Expand Down

0 comments on commit 9a9a182

Please sign in to comment.