Subject: | Archive::Zip check occurs too soon |
Firstly, thanks! cpanminus is great.
It's useful for cpanminus to be able to install many modules with a single command. We use something like "cpanm $(cat modules.txt)" to
install/update many modules.
The Test::Warn distro uses a .zip file so needs Archive::Zip installed. Sadly, adding Archive::Zip to modules.txt doesn't work because cpanm has
already decided that's it's not available so won't use it, even though it's been installed by the time it's needed.
Changing this chunk:
} elsif (eval { require Archive::Zip }) {
$self->chat("You have Archive::Zip $Archive::Zip::VERSION\n");
$self->{_backends}{unzip} = sub {
my($self, $file) = @_;
my $zip = Archive::Zip->new();
...
};
} else {
$self->{_backends}{unzip} = sub {
die "Failed to extract $_[1] - You need to have unzip or Archive::Zip installed.\n";
};
}
to something like this:
} else {
$self->{_backends}{unzip} = sub {
eval { require Archive::Zip }
or die "Failed to extract $_[1] - You need to have unzip or Archive::Zip installed.\n";
my($self, $file) = @_;
my $zip = Archive::Zip->new();
...
};
}
would fix it.