From: Rafael Garcia-Suarez Date: Mon, 6 Oct 2003 11:46:14 +0000 (+0000) Subject: Add a new option --check to Porting/Maintainers, X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=678b26d7b9646dc9eb095b5ecda180cacd3ce8a1;p=p5sagit%2Fp5-mst-13.2.git Add a new option --check to Porting/Maintainers, to check for files who are listed for several maintainers. p4raw-id: //depot/perl@21408 --- diff --git a/Porting/Maintainers.pm b/Porting/Maintainers.pm index 3cf4856..b8959e8 100644 --- a/Porting/Maintainers.pm +++ b/Porting/Maintainers.pm @@ -67,10 +67,11 @@ sub get_maintainer_modules { sub usage { print <<__EOF__; -$0: Usage: $0 [[--maintainer M --module M --files]|file ...] +$0: Usage: $0 [[--maintainer M --module M --files --check]|file ...] --maintainer M list all maintainers matching M --module M list all modules matching M --files list all files +--check check consistency of Maintainers.pl Matching is case-ignoring regexp, author matching is both by the short id and by the full name and email. A "module" may not be just a module, it may be a file or files or a subdirectory. @@ -82,6 +83,7 @@ __EOF__ my $Maintainer; my $Module; my $Files; +my $Check; sub process_options { usage() @@ -90,6 +92,7 @@ sub process_options { 'maintainer=s' => \$Maintainer, 'module=s' => \$Module, 'files' => \$Files, + 'check' => \$Check, ); my @Files = @ARGV; @@ -219,10 +222,27 @@ sub show_results { } } } + elsif ($Check) { + duplicated_maintainers(); + } else { usage(); } } +sub duplicated_maintainers { + my %files; + for my $k (keys %Modules) { + for my $f (get_module_files($k)) { + ++$files{$f}; + } + } + for my $f (keys %files) { + if ($files{$f} > 1) { + warn "File $f appears $files{$f} times in Maintainers.pl\n"; + } + } +} + 1;