Skip Menu |

This queue is for tickets about the Module-CPANTS-Analyse CPAN distribution.

Report information
The Basics
Id: 41506
Status: resolved
Priority: 0/
Queue: Module-CPANTS-Analyse

People
Owner: frequency [...] cpan.org
Requestors: NKH [...] cpan.org
Cc:
AdminCc:

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



Subject: Incorrectly reported symlink error
Check for symlinks all over the place when only the files that are in the distribution (MANIFEST) should be checked. The example I have is a .git which is a symlink so Test::Kwalitee fails. Module/CPANTS/Kwalitee/Files.pm reports "Remove the symlinkes from the distribution.This distribution includes ..." The attached patch uses File::Slurp so you may want to modify it to use another mechanism.
Subject: CPANTS_Kwalitee_Files.patch
--- /usr/lib64/perl5/site_perl/5.8.8/Module/CPANTS/Kwalitee/Files.pm 2008-07-08 10:23:59.000000000 +0200 +++ Files.pm 2008-11-01 19:19:46.000000000 +0100 @@ -59,12 +59,25 @@ #die Dumper \%files; $me->d->{size_unpacked}=$size; - # find symlinks my @symlinks; - foreach my $f (@dirs, @files) { - my $p=catfile($distdir,$f); - if (-l $f) { - push(@symlinks,$f); + + if(-e 'MANIFEST'){ + use File::Slurp ; + + my %file_in_manifest = map + { + chomp($_); + s/^\s+// ; + s/\s+$// ; + $_ => 1 ; + } read_file('MANIFEST') ; + + # find symlinks + foreach my $f (grep {exists $file_in_manifest{$_}} @dirs,@files) { + my $p=catfile($distdir,$f); + if (-l $f) { + push(@symlinks,$f); + } } }
From: frequency [...] cpan.org
Hi: On Sun Dec 07 10:19:44 2008, NKH wrote: Show quoted text
> Check for symlinks all over the place when only the files that are in the > distribution (MANIFEST) should be checked. The example I have is a .git > which is a symlink so Test::Kwalitee fails. > > Module/CPANTS/Kwalitee/Files.pm reports "Remove the symlinkes from the > distribution.This distribution includes ..."
I'm seeing the same error. Show quoted text
> > The attached patch uses File::Slurp so you may want to modify it to use > another mechanism. >
Thanks for your patch, I'll use it as inspiration to fix things. I'm technically one of the maintainers but I've not worked extensively with the CPANTS Analyser yet -- I'll discuss with chorny how we can proceed. I'll likely use Module::Manifest rather than slurping the file and parsing using regexps -- it seems a bit more robust that way.
fixed in 0.86