diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-12-18 10:35:09 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-12-19 13:55:19 +0100 |
commit | d4c6b7ae2c2b00211f9528f146804b76b755480d (patch) | |
tree | d6a7c84d267626c3e4db22af778c3b0fc708507e /Porting/pod_lib.pl | |
parent | 449e2f794bd454dce291b0a7192232fe882f1318 (diff) | |
download | perl-d4c6b7ae2c2b00211f9528f146804b76b755480d.tar.gz |
Change get_pod_metadata() to take a callback to report consistency errors.
Using the callback to report errors instead of passing the 'inconsistent'
arrayref back in the state means that get_pod_metadata() doesn't even need
to calculate this information if it's not going to be used.
Diffstat (limited to 'Porting/pod_lib.pl')
-rw-r--r-- | Porting/pod_lib.pl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Porting/pod_lib.pl b/Porting/pod_lib.pl index 3676953db6..b9a9ef7795 100644 --- a/Porting/pod_lib.pl +++ b/Porting/pod_lib.pl @@ -50,6 +50,8 @@ sub is_duplicate_pod { 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 (@_) { @@ -146,6 +148,8 @@ sub get_pod_metadata { } close $master or my_die "close pod.lst: $!"; + return \%state unless $callback; + # Sanity cross check my (%disk_pods, %manipods, %manireadmes, %perlpods); @@ -245,7 +249,7 @@ sub get_pod_metadata { or $not_yet_there{$i}; } } - $state{inconsistent} = \@inconsistent; + &$callback(@inconsistent); return \%state; } |