The patch titled Subject: get_maintainer.pl: add -mpath=<path or file> for MAINTAINERS file location has been added to the -mm tree. Its filename is get_maintainerpl-add-mpath=path-or-file-for-maintainers-file-location.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/get_maintainerpl-add-mpath%3Dpath-or-file-for-maintainers-file-location.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/get_maintainerpl-add-mpath%3Dpath-or-file-for-maintainers-file-location.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Joe Perches <joe@xxxxxxxxxxx> Subject: get_maintainer.pl: add -mpath=<path or file> for MAINTAINERS file location Add the ability to have an override for the location of the MAINTAINERS file. Miscellanea: o Properly indent a few lines with leading spaces Link: http://lkml.kernel.org/r/a86e69195076ed3c4c526fddc76b86c28e0a1e37.camel@xxxxxxxxxxx Signed-off-by: Joe Perches <joe@xxxxxxxxxxx> Suggested-by: Don Zickus <dzickus@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- diff -puN scripts/get_maintainer.pl~get_maintainerpl-add-mpath=path-or-file-for-maintainers-file-location scripts/get_maintainer.pl --- a/scripts/get_maintainer.pl~get_maintainerpl-add-mpath=path-or-file-for-maintainers-file-location +++ a/scripts/get_maintainer.pl @@ -62,7 +62,7 @@ my $self_test = undef; my $version = 0; my $help = 0; my $find_maintainer_files = 0; - +my $maintainer_path; my $vcs_used = 0; my $exit = 0; @@ -265,6 +265,7 @@ if (!GetOptions( 'fe|file-emails!' => \$file_emails, 'f|file' => \$from_filename, 'find-maintainer-files' => \$find_maintainer_files, + 'mpath|maintainer-path=s' => \$maintainer_path, 'self-test:s' => \$self_test, 'v|version' => \$version, 'h|help|usage' => \$help, @@ -386,26 +387,37 @@ sub find_ignore_git { read_all_maintainer_files(); sub read_all_maintainer_files { - if (-d "${lk_path}MAINTAINERS") { - opendir(DIR, "${lk_path}MAINTAINERS") or die $!; - my @files = readdir(DIR); - closedir(DIR); - foreach my $file (@files) { - push(@mfiles, "${lk_path}MAINTAINERS/$file") if ($file !~ /^\./); - } + my $path = "${lk_path}MAINTAINERS"; + if (defined $maintainer_path) { + $path = $maintainer_path; + # Perl Cookbook tilde expansion if necessary + $path =~ s@^~([^/]*)@ $1 ? (getpwnam($1))[7] : ( $ENV{HOME} || $ENV{LOGDIR} || (getpwuid($<))[7])@ex; } - if ($find_maintainer_files) { - find( { wanted => \&find_is_maintainer_file, - preprocess => \&find_ignore_git, - no_chdir => 1, - }, "${lk_path}"); + if (-d $path) { + $path .= '/' if ($path !~ m@/$@); + if ($path eq "${lk_path}MAINTAINERS/") { + opendir(DIR, "$path") or die $!; + my @files = readdir(DIR); + closedir(DIR); + foreach my $file (@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 { - push(@mfiles, "${lk_path}MAINTAINERS") if -f "${lk_path}MAINTAINERS"; + die "$P: MAINTAINER file not found '$path'\n"; } - + die "$P: No MAINTAINER files found in '$path'\n" if (scalar(@mfiles) == 0); foreach my $file (@mfiles) { - read_maintainer_file("$file"); + read_maintainer_file("$file"); } } _ Patches currently in -mm which might be from joe@xxxxxxxxxxx are spdxcheck-work-with-current-head-licenses-directory.patch get_maintainerpl-add-mpath=path-or-file-for-maintainers-file-location.patch checkpatch-add-a-strict-test-for-structs-with-bool-member-definitions.patch checkpatch-add-fix-for-concatenated_string-and-string_fragments.patch checkpatch-improve-runtime-execution-speed-a-little.patch checkpatch-fix-macro-argument-reuse-test.patch checkpatch-validate-spdx-license-with-spdxcheckpy.patch checkpatch-fix-krealloc-reuse-test.patch checkpatch-check-for-functions-with-passed-by-value-structs-or-unions.patch checkpatch-warn-when-a-patch-doesnt-have-a-description.patch checkpatch-fix-spdx-license-check-with-root=path.patch checkpatch-warn-on-unnecessary-int-declarations.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html