summaryrefslogtreecommitdiff
path: root/Porting/Maintainers.pm
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-10-06 11:46:14 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-10-06 11:46:14 +0000
commit678b26d7b9646dc9eb095b5ecda180cacd3ce8a1 (patch)
tree3b244b5718bf57f3150d58583631e6b9773753ff /Porting/Maintainers.pm
parent3e9ed10aee9762a257f9fbd3063cd2e9c7344cea (diff)
downloadperl-678b26d7b9646dc9eb095b5ecda180cacd3ce8a1.tar.gz
Add a new option --check to Porting/Maintainers,
to check for files who are listed for several maintainers. p4raw-id: //depot/perl@21408
Diffstat (limited to 'Porting/Maintainers.pm')
-rw-r--r--Porting/Maintainers.pm22
1 files changed, 21 insertions, 1 deletions
diff --git a/Porting/Maintainers.pm b/Porting/Maintainers.pm
index 3cf48560c6..b8959e820a 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;