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);
+ }
}
}