From 9bbb230a203c96fa7e8a45ef46e37c00319fafb1 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Thu, 22 Dec 2011 11:26:29 +0100 Subject: 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'. --- installman | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) (limited to 'installman') 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 -- cgit v1.2.1