Subject: | perlbrew 'mirror' doesn't work with GNU wget |
Perl & OS
---------
$ perl -v
This is perl, v5.10.0 built for darwin-2level
$ uname -a
Darwin owncloselady-lm 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15
16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386 i386
$ pmvers App::perlbrew
0.13
Bug & steps to reproduce
------------------------
On a system with "GNU wget" installed, the following happens:
$ perlbrew mirror
Fetching mirror list
wget: unrecognized option `--no-check-certificate'
You didn't select a mirror!
$ wget --version
GNU Wget 1.11.4
<snip>
$ wget --help | grep "no-check-certificate"
Codefix
-------
Note, it seems to work on my system if I just omit the
no-check-certificate (I'm _guessing_ this is default in GNU wget).
Here's code that seems to work (not tested on non-GNU wget system):
Substitute at Line 602, perlbrew.pm
# GNU wget has no '--no-check-certificate' option.
my @wget_type = `wget --version`;
die "wget not installed or not on \$PATH" unless @wget_type;
my $wget_is_gnu = $wget_type [0] =~ /^GNU/ ? 1 : 0;
my @command;
sub _http_get {
my ($self, $url, $cb, $header) = @_;
my @wget_exec = $wget_is_gnu ?
qw( wget --quiet -O - ) :
qw( wget --no-check-certificate --quiet -O - );
if (! @command) {
my @commands = (
[qw( curl --silent --location )],
\@wget_exec,
# [qw( wget --no-check-certificate --quiet -O - )],
);