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.
my $Maintainer;
my $Module;
my $Files;
+my $Check;
sub process_options {
usage()
'maintainer=s' => \$Maintainer,
'module=s' => \$Module,
'files' => \$Files,
+ 'check' => \$Check,
);
my @Files = @ARGV;
}
}
}
+ 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;