Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Joe Perches and committed by
Linus Torvalds
0fbd75fd 5f0baf95

+6 -7
+6 -7
scripts/get_maintainer.pl
··· 396 396 397 397 if (-d $path) { 398 398 $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 { 400 405 opendir(DIR, "$path") or die $!; 401 406 my @files = readdir(DIR); 402 407 closedir(DIR); 403 408 foreach my $file (@files) { 404 409 push(@mfiles, "$path$file") if ($file !~ /^\./); 405 410 } 406 - } 407 - if ($find_maintainer_files) { 408 - find( { wanted => \&find_is_maintainer_file, 409 - preprocess => \&find_ignore_git, 410 - no_chdir => 1, 411 - }, "$path"); 412 411 } 413 412 } elsif (-f "$path") { 414 413 push(@mfiles, "$path");