Re: [PATCH V2 (changelog update only)] scripts/get_maintainer.pl:Add --sections, print entire matched subsystem

From: Stefan Richter
Date: Fri Jan 15 2010 - 09:29:49 EST


Joe Perches wrote:
> Sample output:
>
> $ ./scripts/get_maintainer.pl --sections -f drivers/net/usb/smsc95xx.c
> USB SMSC95XX ETHERNET DRIVER
> M:Steve Glendinning <steve.glendinning@xxxxxxxx>
> L:netdev@xxxxxxxxxxxxxxx
> S:Supported
> F:drivers/net/usb/smsc95xx.*
> USB SUBSYSTEM
> M:Greg Kroah-Hartman <gregkh@xxxxxxx>
> L:linux-usb@xxxxxxxxxxxxxxx
> W:http://www.linux-usb.org
> T:quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/
[...]

Should it be machine-readable, or only human-readable?
In the latter case, some whitespace could be nice, like:

$ ./scripts/get_maintainer.pl --sections -f drivers/net/usb/smsc95xx.c

USB SMSC95XX ETHERNET DRIVER
M:Steve Glendinning <steve.glendinning@xxxxxxxx>
L:netdev@xxxxxxxxxxxxxxx
S:Supported
F:drivers/net/usb/smsc95xx.*

USB SUBSYSTEM
M:Greg Kroah-Hartman <gregkh@xxxxxxx>
L:linux-usb@xxxxxxxxxxxxxxx
W:http://www.linux-usb.org
T:quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/
[...]

For example,

> @@ -346,6 +358,21 @@ foreach my $file (@files) {
> }
> foreach my $line (sort {$hash{$b} <=> $hash{$a}} keys %hash) {
> add_categories($line);
> + if ($sections) {
> + my $i;
> + my $start = find_starting_index($line);
> + my $end = find_ending_index($line);
> + for ($i = $start; $i < $end; $i++) {
> + my $line = $typevalue[$i];
> + if ($line =~ /^[FX]:/) { ##Restore file patterns
> + $line =~ s/([^\\])\.([^\*])/$1\?$2/g;
> + $line =~ s/([^\\])\.$/$1\?/g; ##Convert . back to ?
> + $line =~ s/\\\./\./g; ##Convert \. to .
> + $line =~ s/\.\*/\*/g; ##Convert .* to *
> + }

if ($line =~ /^.:/)
print(" ");
else
print("\n");

> + print("$line\n");
> + }
> + }
> }
> }
>

--
Stefan Richter
-=====-==-=- ---= -====
http://arcgraph.de/sr/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/