summaryrefslogtreecommitdiff
path: root/installman
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-12-22 11:26:29 +0100
committerNicholas Clark <nick@ccl4.org>2011-12-24 09:30:09 +0100
commit9bbb230a203c96fa7e8a45ef46e37c00319fafb1 (patch)
treed6bb6acdc88be55d591dbd6e678d4caf805bcfb6 /installman
parent3bf293368e665fedf90271ec12ba69772cca9a5c (diff)
downloadperl-9bbb230a203c96fa7e8a45ef46e37c00319fafb1.tar.gz
Move the common Pod scanning code from installman and buildtoc to pod_lib.pl
The unified code to scan lib/ for Pod is now in pods_to_install(). It returns found Pods partitioned into 'MODULE' and 'PRAGMA', as buildtoc needs this distinction. installman installs Pods in the same order as before, as 'PRAGMA' sort lexically after 'MODULE'.
Diffstat (limited to 'installman')
-rwxr-xr-xinstallman29
1 files changed, 3 insertions, 26 deletions
diff --git a/installman b/installman
index 263e7ced29..ced3028dc0 100755
--- a/installman
+++ b/installman
@@ -8,7 +8,6 @@ BEGIN {
use strict;
use Getopt::Long;
-use File::Find;
use File::Path qw(mkpath);
use ExtUtils::Packlist;
use Pod::Man;
@@ -73,31 +72,9 @@ pod2man({
# Install the pods for library modules.
{
- # manpages not to be installed
- my %do_not_install = map { ($_ => 1) }
- qw(Pod::Functions XS::APItest XS::Typemap);
-
- my %modpods;
- File::Find::find({no_chdir=>1,
- wanted => sub {
- # $_ is $File::Find::name when using no_chdir
- if (-f $_ and /\.p(?:m|od)$/) {
- return if m!(?:^|/)t/!;
- return if m!lib/Net/FTP/.+\.pm!; # Hi, Graham! :-)
- # Skip .pm files that have corresponding .pod files
- return if s!\.pm\z!.pod! && -e $_;
- s!\.pod\z!!;
- s!\Alib/!!;
- s!/!::!g;
-
- return if $do_not_install{$_};
- return if is_duplicate_pod($File::Find::name);
- $modpods{$_} = $File::Find::name;
- }
- }},
- 'lib');
-
- pod2man(\%modpods, $opts{man3dir}, $opts{man3ext}, 'lib');
+ my $found = pods_to_install();
+ pod2man($found->{$_}, $opts{man3dir}, $opts{man3ext}, 'lib')
+ foreach qw(MODULE PRAGMA);
}
# Install the pods embedded in the installed scripts