From 3bf293368e665fedf90271ec12ba69772cca9a5c Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Thu, 22 Dec 2011 10:41:58 +0100 Subject: [PATCH] Refactor buildtoc's use of File::Find::find() to converge with installman's. --- pod/buildtoc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pod/buildtoc b/pod/buildtoc index cf17a9a..61ea096 100644 --- a/pod/buildtoc +++ b/pod/buildtoc @@ -24,22 +24,27 @@ die "$0: Usage: $0 [--quiet]\n" my $state = get_pod_metadata(0, sub { warn @_ if @_ }, 'pod/perltoc.pod'); # Find all the modules +# manpages not to be installed +my %do_not_install = map { ($_ => 1) } + qw(Pod::Functions XS::APItest XS::Typemap); + my %done; find({no_chdir => 1, wanted => sub { if (/\.p(od|m)$/) { - return if m!/Pod/Functions.pm\z!; # Used only by pod itself return if m!(?:^|/)t/!; return if m!lib/Net/FTP/.+\.pm!; # Hi, Graham! :-) - return if m!XS/(?:APItest|Typemap)!; - return if s!pm\z!pod! && -e $_; + return if s!\.pm\z!.pod! && -e $_; s!\.pod\z!!; s!\Alib/!!; s!/!::!g; my_die("Duplicate files for $_, '$done{$_}' and '$File::Find::name'") if exists $done{$_}; - $done{$_} = $File::Find::name; + + return if $do_not_install{$_}; + return if is_duplicate_pod($File::Find::name); + $Found{/\A[a-z]/ ? 'PRAGMA' : 'MODULE'}{$_} = $File::Find::name; } }}, 'lib'); @@ -91,7 +96,6 @@ foreach my $type (qw(PRAGMA MODULE)) { EOPOD2B foreach my $name (sort keys %{$Found{$type}}) { - next if is_duplicate_pod($Found{$type}{$name}); $roffitall .= " \$libdir/$name.3 \\\n"; podset($name, $Found{$type}{$name}); } -- 2.7.4