summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-12-19 19:34:56 +0100
committerNicholas Clark <nick@ccl4.org>2011-12-21 09:07:27 +0100
commit4e604983952b1d2a9eb17c9c99e4d1d4947f3010 (patch)
tree72249b007019cb60713748d7231b04e547298ef3
parent0aef0fe5d2d4655704f4ccaaacd38582e3744d71 (diff)
downloadperl-4e604983952b1d2a9eb17c9c99e4d1d4947f3010.tar.gz
Rationalise use of the Pod metadata structure returned by get_pod_metadata().
Nothing uses the entries in the 'master' array for the for the elements flagged as 'aux', so don't generate them. Only buildtoc uses the the 'aux' hash, and only the keys in sorted order, so replace the hash with a sorted array. All entries in the 'master' array are now defined, and references to 5 element arrays, so remove code that checks for this. Likewise, as the 'aux' flag is no longer used, remove code related to it. When generating the entries for README files in %our_pods in the consistency checking code in get_pod_metadata, $_->[4] and $_->[1] will always be equal, as no READMEs are copied from dual life modules. So use $_->[1] instead, as this permits a future simplification.
-rw-r--r--Porting/pod_lib.pl14
-rwxr-xr-xinstallman2
-rw-r--r--pod/buildtoc4
3 files changed, 7 insertions, 13 deletions
diff --git a/Porting/pod_lib.pl b/Porting/pod_lib.pl
index 1c9b7bbce1..d6b43764a8 100644
--- a/Porting/pod_lib.pl
+++ b/Porting/pod_lib.pl
@@ -56,7 +56,7 @@ my %state = (
unless (%Lengths) {
__prime_state() unless $state{master};
foreach (@{$state{master}}) {
- next if !$_ || @$_ < 4 || $_->[1] eq $_->[4];
+ next if $_->[1] eq $_->[4];
# 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.
@@ -116,7 +116,7 @@ sub __prime_state {
push @paths, [qr/\A$args[0]\z/, $args[1]];
} elsif ($command eq 'aux') {
# The contents of perltoc.pod's "AUXILIARY DOCUMENTATION" section
- $state{aux}{$_} = '' foreach @args;
+ $state{aux} = [sort @args];
} else {
my_die("Unknown buildtoc command '$command'");
}
@@ -186,12 +186,6 @@ sub __prime_state {
my_die("perl.pod sets flags for unknown pods: "
. join ' ', sort keys %flag_set)
if keys %flag_set;
-
- # This "structure" is identical to the array reference generated by the
- # previous code from pod.lst. It's likely that it can be simplified.
- push @{$state{master}},
- [{aux => 1, toc_omit => 1}, $_, "pod/$_.pod", '', $_]
- foreach sort keys %{$state{aux}}
}
sub get_pod_metadata {
@@ -225,8 +219,8 @@ sub get_pod_metadata {
# Convert these to a list of filenames.
++$our_pods{"$_.pod"} foreach keys %{$state{pods}};
foreach (@{$state{master}}) {
- ++$our_pods{"$_->[1].pod"}
- if defined $_ && @$_ == 5 && $_->[0]{readme};
+ ++$our_pods{"$_->[4].pod"}
+ if $_->[0]{readme};
}
opendir my $dh, 'pod';
diff --git a/installman b/installman
index e986a78410..37d9699f6b 100755
--- a/installman
+++ b/installman
@@ -74,7 +74,7 @@ my %do_not_install = map { ($_ => 1) } qw(
# Install the main pod pages.
pod2man({
map {
- $_ && @$_ > 2 && !$_->[0]{aux} ? ($_->[4], $_->[2]): ()
+ ($_->[4], $_->[2])
} @{$state->{master}}
}, $opts{man1dir}, $opts{man1ext});
diff --git a/pod/buildtoc b/pod/buildtoc
index a8a05ff414..3ab42d3770 100644
--- a/pod/buildtoc
+++ b/pod/buildtoc
@@ -76,7 +76,7 @@ my $roffitall;
EOPOD2B
# All the things in the master list that happen to be pod filenames
-foreach (grep {defined $_ && @$_ == 5 && !$_->[0]{toc_omit}} @{$state->{master}}) {
+foreach (grep {!$_->[0]{toc_omit}} @{$state->{master}}) {
$roffitall .= " \$mandir/$_->[4].1 \\\n";
podset($_->[4], $_->[2]);
}
@@ -109,7 +109,7 @@ $_= <<"EOPOD2B";
EOPOD2B
-$_ .= join "\n", map {"\t=item $_\n"} sort keys %{$state->{aux}};
+$_ .= join "\n", map {"\t=item $_\n"} @{$state->{aux}};
$_ .= <<"EOPOD2B" ;
=back