From c26a697bb0fc682eb6ae9f58c6372d8e19d482b2 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Wed, 9 Nov 2011 17:25:57 +0100 Subject: [PATCH] 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. --- Porting/pod_lib.pl | 15 +++++++++++++-- Porting/pod_rules.pl | 2 +- pod/buildtoc | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Porting/pod_lib.pl b/Porting/pod_lib.pl index 684b494..6caeb19 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 d7b7842..35e26c9 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 ef7cbb0..4058181 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}}; -- 2.7.4