diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-12-22 10:41:58 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-12-24 09:30:09 +0100 |
commit | 3bf293368e665fedf90271ec12ba69772cca9a5c (patch) | |
tree | 06b393c3f8377b6f58f70f873fb9f3a61e763d85 /pod/buildtoc | |
parent | 107ea3f3b2907d129d25d6e10ee8ac692efad5c5 (diff) | |
download | perl-3bf293368e665fedf90271ec12ba69772cca9a5c.tar.gz |
Refactor buildtoc's use of File::Find::find() to converge with installman's.
Diffstat (limited to 'pod/buildtoc')
-rw-r--r-- | pod/buildtoc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/pod/buildtoc b/pod/buildtoc index cf17a9a877..61ea096a47 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}); } |