Subject: | wrong filename tested for symlink |
Date: | Thu, 15 Oct 2009 09:08:54 +1100 |
To: | bug-Module-CPANTS-Analyse [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
In the debian packaged cpants 0.85, I believe Files.pm tests the wrong
filename when looking for symlinks in the dist, as per below.
I struck this when running cpants_lint on a .tar.gz file but with my
working dir as the current directory. The work dir has symlinks, but
the .tar.gz has only plain files, and I hoped cpants_lint would report
about the .tar.gz, not about what the current directory happens to have.
Is the current directory normally the unpacked dist? If not then I
wonder if the $f there could mean the symlinks test never triggered at
all, normally.
(For what it's worth warnings::unused reports the $p there as unused.
It says %reqfiles is unused too, if that was meant to be anything.)
--- Files.pm.old 2009-10-13 18:40:59.000000000 +1100
+++ Files.pm 2009-10-13 18:40:22.000000000 +1100
@@ -63,7 +63,7 @@
my @symlinks;
foreach my $f (@dirs, @files) {
my $p=catfile($distdir,$f);
- if (-l $f) {
+ if (-l $p) {
push(@symlinks,$f);
}
}