summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-10-26 14:22:53 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-26 16:52:17 -0700
commitbcde44ed7d2a58733efdf04b5392c027d1348bac (patch)
tree09ce6f1b82f592364ec86fa380342f39ccefe981
parente3e9d11479737692f797bad1762f71468d577a93 (diff)
downloadlwn-bcde44ed7d2a58733efdf04b5392c027d1348bac.tar.gz
lwn-bcde44ed7d2a58733efdf04b5392c027d1348bac.zip
scripts/get_maintainer.pl: use .get_maintainer.conf from . then $HOME then scripts
On Mon, 2010-09-13 at 00:01 -0400, Valdis.Kletnieks@vt.edu wrote: > Any chance of getting that to be ~/.get_maintainer.conf rather than > ./.get_maintainer.conf? I've just gotten bit like the 3rd or 4th time by > "oh but you didn't create that file in *this* tree" > (I usually have a linus git tree, a linux-next tree, and 3-4 -mm trees) Sure. Add a search path for the .conf file. 3 paths are added: . customized per-tree configurations $HOME user global configuration when per-tree configs don't exist ./scripts lk defaults to override script Signed-off-by: Joe Perches <joe@perches.com> Cc: Valdis Kletnieks <Valdis.Kletnieks@vt.edu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rwxr-xr-xscripts/get_maintainer.pl20
1 files changed, 17 insertions, 3 deletions
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index f46576949ccb..e5a400c53bf0 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -110,10 +110,12 @@ my %VCS_cmds_hg = (
"blame_commit_pattern" => "^([0-9a-f]+):"
);
-if (-f "${lk_path}.get_maintainer.conf") {
+my $conf = which_conf(".get_maintainer.conf");
+if (-f $conf) {
my @conf_args;
- open(my $conffile, '<', "${lk_path}.get_maintainer.conf")
- or warn "$P: Can't open .get_maintainer.conf: $!\n";
+ open(my $conffile, '<', "$conf")
+ or warn "$P: Can't find a readable .get_maintainer.conf file $!\n";
+
while (<$conffile>) {
my $line = $_;
@@ -961,6 +963,18 @@ sub which {
return "";
}
+sub which_conf {
+ my ($conf) = @_;
+
+ foreach my $path (split(/:/, ".:$ENV{HOME}:.scripts")) {
+ if (-e "$path/$conf") {
+ return "$path/$conf";
+ }
+ }
+
+ return "";
+}
+
sub mailmap {
my (@lines) = @_;
my %hash;