From 32fa42475ff8097a96a0a262831e98f6e612110f Mon Sep 17 00:00:00 2001 From: ambs Date: Sat, 10 Oct 2015 20:58:32 +0100 Subject: [PATCH] Ignore if manifest includes duplicates --- lib/Module/CPANTS/Kwalitee/Manifest.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Module/CPANTS/Kwalitee/Manifest.pm b/lib/Module/CPANTS/Kwalitee/Manifest.pm index c5ac127..86c2362 100644 --- a/lib/Module/CPANTS/Kwalitee/Manifest.pm +++ b/lib/Module/CPANTS/Kwalitee/Manifest.pm @@ -26,7 +26,7 @@ sub analyse { if (-e $manifest_file) { # read manifest open(my $fh, '<', $manifest_file) || die "cannot read MANIFEST $manifest_file: $!"; - my @manifest; + my %manifest; while (<$fh>) { chomp; next if /^\s*#/; # discard pure comments @@ -36,11 +36,11 @@ sub analyse { s/\s.*$//; } # strip quotes and comments next unless $_; # discard blank lines - push(@manifest,$_); + $manifest{$_}++; } close $fh; - @manifest=sort @manifest; + my @manifest=sort keys %manifest; my @files=sort @files; my $diff=Array::Diff->diff(\@manifest,\@files);