summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-11-10 11:18:06 +0100
committerNicholas Clark <nick@ccl4.org>2011-11-18 11:08:58 +0100
commit9e241592f0b49731f51cf488e02c09dc84753e5d (patch)
tree6f61837e303bd4d8988c08054d72fbd2d3846333
parentbcfe7366a024445f7575d1c34add01b8f02b72b3 (diff)
downloadperl-9e241592f0b49731f51cf488e02c09dc84753e5d.tar.gz
Porting/pod_rules.pl should not warn about files that it is rebuilding.
Previously it would generate warnings about inconsistencies in files, even if it was about to rewrite the file to be consistent.
-rw-r--r--Porting/pod_lib.pl33
-rw-r--r--Porting/pod_rules.pl5
2 files changed, 25 insertions, 13 deletions
diff --git a/Porting/pod_lib.pl b/Porting/pod_lib.pl
index 0d7755bdc3..25e33d58bc 100644
--- a/Porting/pod_lib.pl
+++ b/Porting/pod_lib.pl
@@ -196,25 +196,34 @@ sub get_pod_metadata {
push @inconsistent, "$0: $i exists but is unknown by buildtoc\n"
unless $our_pods{$i};
push @inconsistent, "$0: $i exists but is unknown by MANIFEST\n"
- if !$manipods{$i} && !$manireadmes{$i} && !$state{copies}{$i}
- && !$state{generated}{$i} && !$cpanpods{$i};
+ if !$BuildFiles{'MANIFEST'} # Ignore if we're rebuilding MANIFEST
+ && !$manipods{$i} && !$manireadmes{$i} && !$state{copies}{$i}
+ && !$state{generated}{$i} && !$cpanpods{$i};
push @inconsistent, "$0: $i exists but is unknown by perl.pod\n"
- if !$perlpods{$i} && !exists $state{copies}{$i} && !$cpanpods{$i} && !$ignoredpods{$i};
+ if !$BuildFiles{'perl.pod'} # Ignore if we're rebuilding perl.pod
+ && !$perlpods{$i} && !exists $state{copies}{$i}
+ && !$cpanpods{$i} && !$ignoredpods{$i};
}
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} or $not_yet_there{$i};
}
- foreach my $i (sort keys %manipods) {
- push @inconsistent, "$0: $i is known by MANIFEST but does not exist\n"
- unless $disk_pods{$i};
- push @inconsistent, "$0: $i is known by MANIFEST but is marked as generated\n"
- if $state{generated}{$i};
+ unless ($BuildFiles{'MANIFEST'}) {
+ # Again, ignore these if we're about to rebuild MANIFEST
+ foreach my $i (sort keys %manipods) {
+ push @inconsistent, "$0: $i is known by MANIFEST but does not exist\n"
+ unless $disk_pods{$i};
+ push @inconsistent, "$0: $i is known by MANIFEST but is marked as generated\n"
+ if $state{generated}{$i};
+ }
}
- 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}
- or $not_yet_there{$i};
+ unless ($BuildFiles{'perl.pod'}) {
+ # Again, ignore these if we're about to rebuild perl.pod
+ 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}
+ or $not_yet_there{$i};
+ }
}
$state{inconsistent} = \@inconsistent;
return \%state;
diff --git a/Porting/pod_rules.pl b/Porting/pod_rules.pl
index 35e26c9642..8be1468967 100644
--- a/Porting/pod_rules.pl
+++ b/Porting/pod_rules.pl
@@ -62,7 +62,10 @@ if ($Verbose) {
print "I will be building $_\n" foreach keys %Build;
}
-my $state = get_pod_metadata(!$Test);
+# For testing, generated files must be present and we're rebuilding nothing.
+# For normal rebuilding, generated files may not be present, and we mute
+# warnings about inconsistencies in any file we're about to rebuild.
+my $state = get_pod_metadata($Test ? () : (1, values %Build));
my $test = 1;
if ($Test) {