summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-11-09 17:25:57 +0100
committerNicholas Clark <nick@ccl4.org>2011-11-18 11:08:58 +0100
commitc26a697bb0fc682eb6ae9f58c6372d8e19d482b2 (patch)
tree95acab7df8f74b7263221940fcf16dec659031ab
parent852355fc8bd0e2a73e60ad29e169fe586d240117 (diff)
downloadperl-c26a697bb0fc682eb6ae9f58c6372d8e19d482b2.tar.gz
Flag to get_pod_metadata() whether generated files are expected.
This permits Porting/pod_rules.pl to be run from a clean checkout without warning, which simplifies updating perl's version.
-rw-r--r--Porting/pod_lib.pl15
-rw-r--r--Porting/pod_rules.pl2
-rw-r--r--pod/buildtoc2
3 files changed, 15 insertions, 4 deletions
diff --git a/Porting/pod_lib.pl b/Porting/pod_lib.pl
index 684b4944a9..6caeb193d0 100644
--- a/Porting/pod_lib.pl
+++ b/Porting/pod_lib.pl
@@ -19,6 +19,8 @@ sub open_or_die {
}
sub get_pod_metadata {
+ # Do we expect to find generated pods on disk?
+ my $permit_missing_generated = shift;
my %BuildFiles;
foreach my $path (@_) {
@@ -162,6 +164,14 @@ sub get_pod_metadata {
my_die "could not find the pod listing of perl.pod\n"
unless %perlpods;
+ # Are we running before known generated files have been generated?
+ # (eg in a clean checkout)
+ my %not_yet_there;
+ if ($permit_missing_generated) {
+ # If so, don't complain if these files aren't yet in place
+ %not_yet_there = (%manireadmes, %{$state{generated}}, %{$state{copies}})
+ }
+
my @inconsistent;
foreach my $i (sort keys %disk_pods) {
push @inconsistent, "$0: $i exists but is unknown by buildtoc\n"
@@ -174,7 +184,7 @@ sub get_pod_metadata {
}
foreach my $i (sort keys %our_pods) {
push @inconsistent, "$0: $i is known by buildtoc but does not exist\n"
- unless $disk_pods{$i} or $BuildFiles{$i};
+ unless $disk_pods{$i} or $BuildFiles{$i} or $not_yet_there{$i};
}
foreach my $i (sort keys %manipods) {
push @inconsistent, "$0: $i is known by MANIFEST but does not exist\n"
@@ -184,7 +194,8 @@ sub get_pod_metadata {
}
foreach my $i (sort keys %perlpods) {
push @inconsistent, "$0: $i is known by perl.pod but does not exist\n"
- unless $disk_pods{$i} or $BuildFiles{$i} or $cpanpods_leaf{$i};
+ unless $disk_pods{$i} or $BuildFiles{$i} or $cpanpods_leaf{$i}
+ or $not_yet_there{$i};
}
$state{inconsistent} = \@inconsistent;
return \%state;
diff --git a/Porting/pod_rules.pl b/Porting/pod_rules.pl
index d7b78421c2..35e26c9642 100644
--- a/Porting/pod_rules.pl
+++ b/Porting/pod_rules.pl
@@ -62,7 +62,7 @@ if ($Verbose) {
print "I will be building $_\n" foreach keys %Build;
}
-my $state = get_pod_metadata();
+my $state = get_pod_metadata(!$Test);
my $test = 1;
if ($Test) {
diff --git a/pod/buildtoc b/pod/buildtoc
index ef7cbb0c37..405818107e 100644
--- a/pod/buildtoc
+++ b/pod/buildtoc
@@ -21,7 +21,7 @@ BEGIN {
die "$0: Usage: $0 [--quiet]\n"
unless GetOptions (quiet => \$Quiet) && !@ARGV;
-my $state = get_pod_metadata('pod/perltoc.pod');
+my $state = get_pod_metadata(0, 'pod/perltoc.pod');
warn @{$state->{inconsistent}} if @{$state->{inconsistent}};