From: Nicholas Clark Date: Thu, 10 Nov 2011 10:18:06 +0000 (+0100) Subject: Porting/pod_rules.pl should not warn about files that it is rebuilding. X-Git-Tag: accepted/trunk/20130322.191538~2111^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9e241592f0b49731f51cf488e02c09dc84753e5d;p=platform%2Fupstream%2Fperl.git 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. --- diff --git a/Porting/pod_lib.pl b/Porting/pod_lib.pl index 0d7755b..25e33d5 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 35e26c9..8be1468 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) {