提交 0fbd75fd 编写于 作者: J Joe Perches 提交者: Linus Torvalds

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.comSigned-off-by: NJoe Perches <joe@perches.com>
Tested-by: NDon Zickus <dzickus@redhat.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 5f0baf95
......@@ -396,7 +396,12 @@ sub read_all_maintainer_files {
if (-d $path) {
$path .= '/' if ($path !~ m@/$@);
if ($path eq "${lk_path}MAINTAINERS/") {
if ($find_maintainer_files) {
find( { wanted => \&find_is_maintainer_file,
preprocess => \&find_ignore_git,
no_chdir => 1,
}, "$path");
} else {
opendir(DIR, "$path") or die $!;
my @files = readdir(DIR);
closedir(DIR);
......@@ -404,12 +409,6 @@ sub read_all_maintainer_files {
push(@mfiles, "$path$file") if ($file !~ /^\./);
}
}
if ($find_maintainer_files) {
find( { wanted => \&find_is_maintainer_file,
preprocess => \&find_ignore_git,
no_chdir => 1,
}, "$path");
}
} elsif (-f "$path") {
push(@mfiles, "$path");
} else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册