public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* using X: in MAINTAINERS is broken
@ 2009-12-23 13:28 Dan Carpenter
  2009-12-23 22:18 ` [PATCH] scripts/get_maintainer.pl: Fix file exclusion X: logic Joe Perches
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2009-12-23 13:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: kalle.valo, johannes

The following command doesn't generate any output.
`./scripts/get_maintainer.pl --no-git -f drivers/net/wireless/wl12xx/wl1271_acx.c`

If you comment out the X: line from the WL1251 it does generate output.
WL1251 WIRELESS DRIVER
M:      Kalle Valo <kalle.valo@nokia.com>
L:      linux-wireless@vger.kernel.org
W:      http://wireless.kernel.org
T:      git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git
S:      Maintained
F:      drivers/net/wireless/wl12xx/*
X:      drivers/net/wireless/wl12xx/wl1271*

WL1271 WIRELESS DRIVER
M:      Luciano Coelho <luciano.coelho@nokia.com>
L:      linux-wireless@vger.kernel.org
W:      http://wireless.kernel.org
T:      git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git
S:      Maintained
F:      drivers/net/wireless/wl12xx/wl1271*

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] scripts/get_maintainer.pl: Fix file exclusion X: logic
  2009-12-23 13:28 using X: in MAINTAINERS is broken Dan Carpenter
@ 2009-12-23 22:18 ` Joe Perches
  0 siblings, 0 replies; 2+ messages in thread
From: Joe Perches @ 2009-12-23 22:18 UTC (permalink / raw)
  To: Dan Carpenter, Andrew Morton; +Cc: linux-kernel, kalle.valo, johannes

On Wed, 2009-12-23 at 15:28 +0200, Dan Carpenter wrote:
> The following command doesn't generate any output.
> `./scripts/get_maintainer.pl --no-git -f drivers/net/wireless/wl12xx/wl1271_acx.c`

An excluded "X:" pattern match in any section
would cause a file not to match any other section.

Signed-off-by: Joe Perches <joe@perches.com>

 scripts/get_maintainer.pl |   86 ++++++++++++++++++++++++++++----------------
 1 files changed, 55 insertions(+), 31 deletions(-)

diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 445e884..090f248 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -296,46 +296,56 @@ my @status = ();
 
 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) {
@@ -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) = @_;
 



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-12-23 22:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-23 13:28 using X: in MAINTAINERS is broken Dan Carpenter
2009-12-23 22:18 ` [PATCH] scripts/get_maintainer.pl: Fix file exclusion X: logic Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox