Subject: | mishandles symbolic links in @INC |
Pod::Find VERSION = 1.34
This is perl, v5.10.0 built for i486-linux-gnu-thread-multi
Linux debian 2.6.26-2-486 #1 Sat Jun 11 14:47:34 UTC 2011 i686 GNU/Linux
Two of my @INC dirs are symlinked.
/usr/lib/perl/5.10 -> 5.10.0
/usr/share/perl/5.10 -> 5.10.0
Pod::Find, by way of Apache2::PodBrowser, does not descend these two
dirs and find the pods.
I've resorted to this silly hack in Pod::Find::pod_find for now:-
# original
if($opts{-inc}) {
if ($^O eq 'MacOS') {
# tolerate '.', './some_dir' and '(../)+some_dir' on Mac OS
my @new_INC = @INC;
for (@new_INC) {
if ( $_ eq '.' ) {
$_ = ':';
} elsif ( $_ =~ s{^((?:\.\./)+)}{':' x (length($1)/3)}e ) {
$_ = ':'. $_;
} else {
$_ =~ s{^\./}{:};
}
}
push(@search, grep($_ ne File::Spec->curdir, @new_INC));
} else {
push(@search, grep($_ ne File::Spec->curdir, @INC));
}
$opts{-perl} = 1;
}
# silly hack
if($opts{-inc}) {
my @new_INC = @INC;
if ($^O eq 'MacOS') {
# tolerate '.', './some_dir' and '(../)+some_dir' on Mac OS
for (@new_INC) {
if ( $_ eq '.' ) {
$_ = ':';
} elsif ( $_ =~ s|^((?:\.\./)+)|':' x (length($1)/3)|e ) {
$_ = ':'. $_;
} else {
$_ =~ s|^\./|:|;
}
}
push(@search, grep($_ ne File::Spec->curdir, @new_INC));
}
else {
foreach my $path( @new_INC ){
if( -l $path ){
chomp( my $real = `ls -l $path` );
( $real ) = $real =~ /([^ ]+)$/;
$path =~ s/[^\/]+$/$real/;
}
}
push(@search, grep($_ ne File::Spec->curdir, @new_INC));
}
$opts{-perl} = 1;
}