# HG changeset patch # User Igor Pashev # Date 1318599760 -14400 # Node ID 11a4d6c5b2708dad93d8bf12f64cfd872967a887 # Parent f1790f276df978dc57884d0618f9d36a3ca909e1 cpan2ips.pl: Filter unique deps diff -r f1790f276df9 -r 11a4d6c5b270 tools/cpan2ips.pl --- a/tools/cpan2ips.pl Fri Oct 14 17:17:46 2011 +0400 +++ b/tools/cpan2ips.pl Fri Oct 14 17:42:40 2011 +0400 @@ -38,6 +38,11 @@ or fatal "Can't create dir `$path': $!"; } } +sub uniq { + my ($array_ref) = @_; + my %hash = map { $_, 1 } @$array_ref; + @$array_ref = keys %hash; +} sub shell_exec { my ($cmd) = @_; @@ -178,6 +183,7 @@ my $dep_pkg_name = do_package($_); push @pkg_deps, $dep_pkg_name if $dep_pkg_name; } + uniq \@pkg_deps; blab "Required for `$pkg_name' packages: ", (join ', ', @pkg_deps);