diff options
author | David Mitchell <davem@iabyn.com> | 2009-05-17 00:31:43 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2009-05-17 01:43:21 +0100 |
commit | da92fd6071387be2a444dac8cdba07b4488e05e0 (patch) | |
tree | 5fcd30c79835178bbb22639f4d812474e87fe765 /Porting/Maintainers.pm | |
parent | 2a570317cfc4bd5eea92957f4973877418392dbe (diff) | |
download | perl-da92fd6071387be2a444dac8cdba07b4488e05e0.tar.gz |
add reload_manifest() function to Porting/maintainers.pm
to allow the MANIFEST file to be read more than once.
Also be more liberal in parsing the MANIFEST file (it now handles
lines with no second column), and warn on bad lines .
Diffstat (limited to 'Porting/Maintainers.pm')
-rw-r--r-- | Porting/Maintainers.pm | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/Porting/Maintainers.pm b/Porting/Maintainers.pm index 666e4516db..7929352e68 100644 --- a/Porting/Maintainers.pm +++ b/Porting/Maintainers.pm @@ -18,25 +18,38 @@ use vars qw(@ISA @EXPORT_OK $VERSION); @ISA = qw(Exporter); @EXPORT_OK = qw(%Modules %Maintainers get_module_files get_module_pat - show_results process_options files_to_modules); -$VERSION = 0.02; + show_results process_options files_to_modules + reload_manifest); +$VERSION = 0.03; require Exporter; use File::Find; use Getopt::Long; my %MANIFEST; -if (open(MANIFEST, "MANIFEST")) { - while (<MANIFEST>) { - if (/^(\S+)\t+(.+)$/) { - $MANIFEST{$1}++; + +# (re)read the MANIFEST file, blowing away any previous effort + +sub reload_manifest { + %MANIFEST = (); + if (open(MANIFEST, "MANIFEST")) { + while (<MANIFEST>) { + if (/^(\S+)/) { + $MANIFEST{$1}++; + } + else { + warn "MANIFEST:$.: malformed line: $_\n"; + } } + close MANIFEST; + } else { + die "$0: Failed to open MANIFEST for reading: $!\n"; } - close MANIFEST; -} else { - die "$0: Failed to open MANIFEST for reading: $!\n"; } +reload_manifest; + + sub get_module_pat { my $m = shift; split ' ', $Modules{$m}{FILES}; |