diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-12-18 11:00:15 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-12-19 13:55:19 +0100 |
commit | 9887f4486771327e32cc7026d4b939cc89ccc7b2 (patch) | |
tree | 79b3b6cca145d1eb88ef61ca3fce95d7e033fdc9 /Porting | |
parent | d4c6b7ae2c2b00211f9528f146804b76b755480d (diff) | |
download | perl-9887f4486771327e32cc7026d4b939cc89ccc7b2.tar.gz |
In pod_lib.pl, split out the code that initialises %state from pod.lst
It's now extracted from get_pod_metadata() into __prime_state().
Diffstat (limited to 'Porting')
-rw-r--r-- | Porting/pod_lib.pl | 50 |
1 files changed, 27 insertions, 23 deletions
diff --git a/Porting/pod_lib.pl b/Porting/pod_lib.pl index b9a9ef7795..e241208751 100644 --- a/Porting/pod_lib.pl +++ b/Porting/pod_lib.pl @@ -37,6 +37,17 @@ sub write_or_die { close $fh or die "Can't close $filename: $!"; } + +my %state = ( + # Don't copy these top level READMEs + ignore => { + micro => 1, + # vms => 1, + }, + ); + +my %Readmepods; + my (%Lengths, %MD5s); sub is_duplicate_pod { @@ -47,28 +58,7 @@ sub is_duplicate_pod { return $Lengths{-s $file} && $MD5s{md5(slurp_or_die($file))}; } -sub get_pod_metadata { - # Do we expect to find generated pods on disk? - my $permit_missing_generated = shift; - # Do they want a consistency report? - my $callback = shift; - my %BuildFiles; - - foreach my $path (@_) { - $path =~ m!([^/]+)$!; - ++$BuildFiles{$1}; - } - - my %state = - ( - # Don't copy these top level READMEs - ignore => - { - micro => 1, - # vms => 1, - }, - ); - +sub __prime_state { my $source = 'perldelta.pod'; my $filename = "pod/$source"; my $fh = open_or_die($filename); @@ -86,7 +76,6 @@ sub get_pod_metadata { # process pod.lst - my %Readmepods; my $master = open_or_die('pod.lst'); foreach (<$master>) { @@ -147,9 +136,24 @@ sub get_pod_metadata { } } close $master or my_die "close pod.lst: $!"; +} + +sub get_pod_metadata { + # Do we expect to find generated pods on disk? + my $permit_missing_generated = shift; + # Do they want a consistency report? + my $callback = shift; + __prime_state() unless $state{master}; return \%state unless $callback; + my %BuildFiles; + + foreach my $path (@_) { + $path =~ m!([^/]+)$!; + ++$BuildFiles{$1}; + } + # Sanity cross check my (%disk_pods, %manipods, %manireadmes, %perlpods); |