diff options
author | Joe Perches <joe@perches.com> | 2018-08-22 00:56:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-08-22 13:52:48 -0400 |
commit | 0fbd75fd7feedd9e38fc1d3a01317aa23b83d29e (patch) | |
tree | 5a3785944369672e354a9c16fcadd5aae7ffe300 | |
parent | 5f0baf95b1edfff5eb9b6f571febb859b047de97 (diff) |
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>
-rwxr-xr-x | scripts/get_maintainer.pl | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index 0ebdefe74d5b..c1c088ef1420 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl | |||
@@ -396,7 +396,12 @@ sub read_all_maintainer_files { | |||
396 | 396 | ||
397 | if (-d $path) { | 397 | if (-d $path) { |
398 | $path .= '/' if ($path !~ m@/$@); | 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 | opendir(DIR, "$path") or die $!; | 405 | opendir(DIR, "$path") or die $!; |
401 | my @files = readdir(DIR); | 406 | my @files = readdir(DIR); |
402 | closedir(DIR); | 407 | closedir(DIR); |
@@ -404,12 +409,6 @@ sub read_all_maintainer_files { | |||
404 | push(@mfiles, "$path$file") if ($file !~ /^\./); | 409 | push(@mfiles, "$path$file") if ($file !~ /^\./); |
405 | } | 410 | } |
406 | } | 411 | } |
407 | if ($find_maintainer_files) { | ||
408 | find( { wanted => \&find_is_maintainer_file, | ||
409 | preprocess => \&find_ignore_git, | ||
410 | no_chdir => 1, | ||
411 | }, "$path"); | ||
412 | } | ||
413 | } elsif (-f "$path") { | 412 | } elsif (-f "$path") { |
414 | push(@mfiles, "$path"); | 413 | push(@mfiles, "$path"); |
415 | } else { | 414 | } else { |