manual_fetch.pl: added curl support, and made it complain if curl nor wget are present

This commit is contained in:
Adrian Kreher 2008-12-12 00:08:16 -06:00
parent 807841a2d0
commit 878552c544

10
manual_fetch.pl Normal file → Executable file
View file

@ -21,7 +21,15 @@ extract_tgz($tgz);
sub http_fetch { sub http_fetch {
my $url = shift; my $url = shift;
return qx{wget -O - '$url'};
# See if we should use wget or curl
if(grep {-x "$_/curl"} split /:/, $ENV{'PATH'}) {
return qx{curl -s '$url'};
} elsif(grep {-x "$_/wget"} split /:/, $ENV{'PATH'}) {
return qx{wget -O - '$url'};
} else {
die "Could not find curl or wget, aborting!";
}
} }
sub extract_tgz { sub extract_tgz {