From 2db7c483adfe796023e6b117428d28c725186f04 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Sun, 27 Nov 2011 13:05:11 +0100 Subject: [PATCH] Fix two post 5.15.0 perltoc.pod generation bugs. Commit 1721346e4e420217, which allowed buildtoc to handle files outside of pod, changed the number of entries in the master structure, but missed changing one test from 3 to 5, which resulted in all the core documentation being omitted from the generated perltoc.pod Commit f37610d895e1d30b, which eliminated the use of absolute pathnames, failed to change two regular expressions in the subroutine passed to File::Find::find(), which resulted in all module pod filenames having lib/ prepended, and thus all modules being treated as pragmata. This commit also contained an error in the call to podset() for the core documentation, which wasn't noticed because that code was never called, due to the bug introduced by commit 1721346e4e420217. perltoc.pod now builds correctly once again. Whether anyone uses it is another matter. --- pod/buildtoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pod/buildtoc b/pod/buildtoc index 930cf70..29c8bc8 100644 --- a/pod/buildtoc +++ b/pod/buildtoc @@ -30,7 +30,7 @@ my @modpods; find(sub { if (/\.p(od|m)$/) { my $file = $File::Find::name; - return if $file =~ qr!/lib/Pod/Functions.pm\z!; # Used only by pod itself + return if $file =~ qr!/Pod/Functions.pm\z!; # Used only by pod itself return if $file =~ m!(?:^|/)t/!; return if $file =~ m!lib/Attribute/Handlers/demo/!; return if $file =~ m!lib/Net/FTP/.+\.pm!; # Hi, Graham! :-) @@ -62,7 +62,7 @@ my %done; for (@modpods) { my $name = $_; $name =~ s/\.p(m|od)$//; - $name =~ s-.*?/lib/--; + $name =~ s-\Alib/--; $name =~ s-/-::-g; next if $done{$name}++; @@ -98,8 +98,8 @@ my $OUT; EOPOD2B # All the things in the master list that happen to be pod filenames -foreach (grep {defined $_ && @$_ == 3 && !$_->[0]{toc_omit}} @{$state->{master}}) { - podset(@$_); +foreach (grep {defined $_ && @$_ == 5 && !$_->[0]{toc_omit}} @{$state->{master}}) { + podset($_->[1], $_->[2]); } foreach my $type (qw(PRAGMA MODULE)) { -- 2.7.4