This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Prune unused entries from the 'master' array returned by get_pod_metadata().
authorNicholas Clark <nick@ccl4.org>
Mon, 19 Dec 2011 19:01:29 +0000 (20:01 +0100)
committerNicholas Clark <nick@ccl4.org>
Wed, 21 Dec 2011 08:07:27 +0000 (09:07 +0100)
The description is only used to generate MANIFEST entries now from 'readmes'
and 'pods'. now that perl.pod is the master and is no longer generated from
pod.lst

The leafname/podname distinction is only used by is_duplicate_pod(), so can
be replaced by simple flag, 'dual'.

Replace the now-unused entries with undef to preserve the indices.

Porting/pod_lib.pl

index d6b4376..7e3cdab 100644 (file)
@@ -56,7 +56,7 @@ my %state = (
         unless (%Lengths) {
             __prime_state() unless $state{master};
             foreach (@{$state{master}}) {
-                next if $_->[1] eq $_->[4];
+                next unless $_->[0]{dual};
                 # This is a dual-life perl*.pod file, which will have be copied
                 # to lib/ by the build process, and hence also found there.
                 # These are the only pod files that might become duplicated.
@@ -152,6 +152,7 @@ sub __prime_state {
 
             my %flags;
             $flags{toc_omit} = 1 if $flags =~ tr/o//d;
+            $flags{dual} = $podname ne $leafname;
 
             $state{generated}{"$podname.pod"}++ if $flags =~ tr/g//d;
 
@@ -166,15 +167,13 @@ sub __prime_state {
             my_die "Unknown flag found in section line: $_" if length $flags;
 
             push @{$state{master}},
-                [\%flags, $podname, $filename, $desc, $leafname];
+                [\%flags, undef, $filename, undef, $leafname];
 
             if ($podname eq 'perldelta') {
                 local $" = '.';
-                my $delta_desc = "Perl changes in version @want";
                 push @{$state{master}},
-                    [{}, $state{delta_target}, "pod/$state{delta_target}",
-                     $delta_desc, $delta_leaf];
-                $state{pods}{$delta_leaf} = $delta_desc;
+                    [{}, undef, "pod/$state{delta_target}", undef, $delta_leaf];
+                $state{pods}{$delta_leaf} = "Perl changes in version @want";
             }
 
         } else {