Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Pod-Simple CPAN distribution.

Report information
The Basics
Id: 20600
Status: resolved
Priority: 0/
Queue: Pod-Simple

People
Owner: Nobody in particular
Requestors: cjm [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 3.04
Fixed in: (no value)



Subject: Pod::Simple::Search skips some architecture directories
I'm using Gentoo Linux and perl 5.8.8. For some reason, some of the architecture directories (i686-linux) are listed after the corresponding non-arch directory in @INC. Pod::Simple::Search has a real problem with that. For example, here's part of my @INC: /usr/lib/perl5/vendor_perl/5.8.8/i686-linux /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.7/i686-linux Pod::Simple::Search looks in the first 3 directories ok, but when it comes to 5.8.7/i686-linux, I get this (with verbose(1)): Looking in dir /usr/lib/perl5/vendor_perl/5.8.7/i686-linux i686-linux is a fishy directory name. Skipping. Back from excursion under /usr/lib/perl5/vendor_perl/5.8.7 Directory '/usr/lib/perl5/vendor_perl/5.8.7/i686-linux' already seen, skipping. Therefore, it doesn't see any modules under /usr/lib/perl5/vendor_perl/5.8.7/i686-linux. I worked around it with the attached patch, but that's probably not the best solution. It should just not mark directories as visited when it's pruning them.
Subject: archname.patch
--- Search.pm~ 2006-07-20 14:40:45.000000000 -0500 +++ Search.pm 2006-05-27 20:44:37.791405455 -0500 @@ -156,6 +156,8 @@ if( m/^([A-Za-z][a-zA-Z0-9_]*)\z/s ) { $verbose and print "$_ is a well-named module subdir. Looking....\n"; + } elsif( $_ eq $Config::Config{'archname'}) { + $verbose and print "$_ is an architecture subdir. Looking....\n"; } else { $verbose and print "$_ is a fishy directory name. Skipping.\n"; return 'PRUNE';
From: cjm [...] pobox.com
I've attached a new patch that takes my suggested approach of marking a directory as visited only if we're not pruning it. I think this patch is suitable for merging. The patch also fixes the documentation for laborious, which incorrectly stated that the default value was true.
--- Search.pm~ 2006-07-20 14:40:45.000000000 -0500 +++ Search.pm 2006-07-21 10:25:17.728022416 -0500 @@ -140,27 +140,27 @@ if( $self->{'_dirs_visited'}{$file} ) { $verbose and print "Directory '$file' already seen, skipping.\n"; return 'PRUNE'; - } else { - $self->{'_dirs_visited'}{$file} = 1; - print "Looking in dir $file\n" if $verbose; # and fallthru } - return if $laborious; # these override pruning + print "Looking in dir $file\n" if $verbose; - if( m/^(\d+\.[\d_]{3,})\z/s - and do { my $x = $1; $x =~ tr/_//d; $x != $] } - ) { - $verbose and print "Perl $] version mismatch on $_, skipping.\n"; - return 'PRUNE'; - } + unless ($laborious) { # $laborious overrides pruning + if( m/^(\d+\.[\d_]{3,})\z/s + and do { my $x = $1; $x =~ tr/_//d; $x != $] } + ) { + $verbose and print "Perl $] version mismatch on $_, skipping.\n"; + return 'PRUNE'; + } - if( m/^([A-Za-z][a-zA-Z0-9_]*)\z/s ) { - $verbose and print "$_ is a well-named module subdir. Looking....\n"; - } else { - $verbose and print "$_ is a fishy directory name. Skipping.\n"; - return 'PRUNE'; - } + if( m/^([A-Za-z][a-zA-Z0-9_]*)\z/s ) { + $verbose and print "$_ is a well-named module subdir. Looking....\n"; + } else { + $verbose and print "$_ is a fishy directory name. Skipping.\n"; + return 'PRUNE'; + } + } # end unless $laborious + $self->{'_dirs_visited'}{$file} = 1; return; # (not pruning); } @@ -790,8 +790,8 @@ Unless you set this attribute to a true value, Pod::Search will apply Perl-specific heuristics to find the correct module PODs quickly. -This attribute's default value is true. You won't normally need -to set this to false. +This attribute's default value is false. You won't normally need +to set this to true. Specifically: Turning on this option will disable the heuristics for seeing only files with Perl-like extensions, omitting subdirectories
Thanks, applied in version 3.05.