Skip to content

Commit 0fbd75f

Browse files
JoePerchestorvalds
authored andcommitted
get_maintainer: allow option --mpath <directory> to read all files in <directory>
There is an external use case for multiple private MAINTAINER style files in a separate directory. Allow it. --mpath has a default of "./MAINTAINERS". The value entered can be either a file or a directory. The behaviors are now: --mpath <file> Read only the specific file as <MAINTAINER_TYPE> file --mpath <directory> Read all files in <directory> as <MAINTAINER_TYPE> files --mpath <directory> --find-maintainer-files Recurse through <directory> and read all files named MAINTAINERS Link: http://lkml.kernel.org/r/991b2f20112d53863cd79e61d908f1d26d3e1971.camel@perches.com Signed-off-by: Joe Perches <joe@perches.com> Tested-by: Don Zickus <dzickus@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 5f0baf9 commit 0fbd75f

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

‎scripts/get_maintainer.pl‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -396,20 +396,19 @@ sub read_all_maintainer_files {
396396

397397
if (-d $path) {
398398
$path .= '/' if ($path !~ m@/$@);
399-
if ($path eq "${lk_path}MAINTAINERS/") {
399+
if ($find_maintainer_files) {
400+
find( { wanted => \&find_is_maintainer_file,
401+
preprocess => \&find_ignore_git,
402+
no_chdir => 1,
403+
}, "$path");
404+
} else {
400405
opendir(DIR, "$path") or die $!;
401406
my @files = readdir(DIR);
402407
closedir(DIR);
403408
foreach my $file (@files) {
404409
push(@mfiles, "$path$file") if ($file !~ /^\./);
405410
}
406411
}
407-
if ($find_maintainer_files) {
408-
find( { wanted => \&find_is_maintainer_file,
409-
preprocess => \&find_ignore_git,
410-
no_chdir => 1,
411-
}, "$path");
412-
}
413412
} elsif (-f "$path") {
414413
push(@mfiles, "$path");
415414
} else {

0 commit comments

Comments
 (0)