lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 16 Oct 2015 10:37:48 -0700
From:	Joe Perches <joe@...ches.com>
To:	Jani Nikula <jani.nikula@...el.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] get_maintainer: add support for using an alternate
 MAINTAINERS file

On Fri, 2015-10-16 at 09:23 -0700, Joe Perches wrote:
> On Fri, 2015-10-16 at 12:14 +0300, Jani Nikula wrote:
> > On Fri, 16 Oct 2015, Joe Perches <joe@...ches.com> wrote:
> > > On Fri, 2015-10-16 at 11:36 +0300, Jani Nikula wrote:
> > >> There are large and/or complex subsystems/drivers that have domain
> > >> experts that should review patches in their domain. One such example is
> > >> drm/i915. We'd like to be able to document this in a way that can be
> > >> automatically queried for each patch, so people know who to ping for
> > >> reviews. This is what get_maintainer.pl already solves.

Maybe this:

It reads optional REVIEWER files in the same style
as MAINTAINERS.

Most of the change is just making a block of code
into a subroutine.

---
 scripts/get_maintainer.pl | 60 +++++++++++++++++++++++++++--------------------
 1 file changed, 35 insertions(+), 25 deletions(-)

diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 98bae86..79ba49a 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -300,35 +300,45 @@ if (!top_of_kernel_tree($lk_path)) {
 my @typevalue = ();
 my %keyword_hash;
 
-open (my $maint, '<', "${lk_path}MAINTAINERS")
-    or die "$P: Can't open MAINTAINERS: $!\n";
-while (<$maint>) {
-    my $line = $_;
-
-    if ($line =~ m/^([A-Z]):\s*(.*)/) {
-	my $type = $1;
-	my $value = $2;
-
-	##Filename pattern matching
-	if ($type eq "F" || $type eq "X") {
-	    $value =~ s@\.@\\\.@g;       ##Convert . to \.
-	    $value =~ s/\*/\.\*/g;       ##Convert * to .*
-	    $value =~ s/\?/\./g;         ##Convert ? to .
-	    ##if pattern is a directory and it lacks a trailing slash, add one
-	    if ((-d $value)) {
-		$value =~ s@([^/])$@$1/@;
+read_maintainer_file("${lk_path}MAINTAINERS");
+
+## Read optional REVIEWERS file(s) too
+my @reviewer_files = glob("${lk_path}REVIEWERS*");
+foreach my $reviewer_file (@reviewer_files) {
+    read_maintainer_file($reviewer_file);
+}
+
+sub read_maintainer_file {
+    my ($file) = @_;
+    open (my $maint, '<', "$file")
+	or die "$P: Can't open $file: $!\n";
+    while (<$maint>) {
+	my $line = $_;
+
+	if ($line =~ m/^([A-Z]):\s*(.*)/) {
+	    my $type = $1;
+	    my $value = $2;
+
+	    ##Filename pattern matching
+	    if ($type eq "F" || $type eq "X") {
+		$value =~ s@\.@\\\.@g;       ##Convert . to \.
+		$value =~ s/\*/\.\*/g;       ##Convert * to .*
+		$value =~ s/\?/\./g;         ##Convert ? to .
+		##if pattern is a directory and it lacks a trailing slash, add one
+		if ((-d $value)) {
+		    $value =~ s@([^/])$@$1/@;
+		}
+	    } elsif ($type eq "K") {
+		$keyword_hash{@...evalue} = $value;
 	    }
-	} elsif ($type eq "K") {
-	    $keyword_hash{@...evalue} = $value;
+	    push(@typevalue, "$type:$value");
+	} elsif (!/^(\s)*$/) {
+	    $line =~ s/\n$//g;
+	    push(@typevalue, $line);
 	}
-	push(@typevalue, "$type:$value");
-    } elsif (!/^(\s)*$/) {
-	$line =~ s/\n$//g;
-	push(@typevalue, $line);
     }
+    close($maint);
 }
-close($maint);
-
 
 #
 # Read mail address map

 

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ