Skip to content

Commit

Permalink
dedupe flattened deps after version check. Fixes gh-32
Browse files Browse the repository at this point in the history
  • Loading branch information
miyagawa committed Apr 10, 2010
1 parent 2dd182b commit 76d73a9
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/App/cpanminus/script.pm
Original file line number Diff line number Diff line change
Expand Up @@ -882,12 +882,13 @@ sub should_install {
sub install_deps {
my($self, $dir, $depth, @deps) = @_;

my %deps = @deps; # XXX

my @install;
while (my($mod, $ver) = each %deps) {
next if $mod eq 'perl' or $mod eq 'Config';
push @install, $self->should_install($mod, $ver);
my(@install, %seen);
while (my($mod, $ver) = splice @deps, 0, 2) {
next if $seen{$mod} or $mod eq 'perl' or $mod eq 'Config';
if ($self->should_install($mod, $ver)) {
push @install, $mod;
$seen{$mod} = 1;
}
}

if (@install) {
Expand Down

0 comments on commit 76d73a9

Please sign in to comment.