Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

support for fetch (default on FreeBSD)

  • Loading branch information...
commit dbe2aa0146583b292ae98b3bdd8be71263aa1702 1 parent 7def8a8
@zzzcpan zzzcpan authored
Showing with 10 additions and 0 deletions.
  1. +4 −0 bin/perlbrew
  2. +4 −0 lib/App/perlbrew.pm
  3. +2 −0  perlbrew-install
View
4 bin/perlbrew
@@ -72,6 +72,10 @@ your terminal:
curl -kL http://install.perlbrew.pl | bash
+Or this one, if you have C<fetch> (default on FreeBSD):
+
+ fetch -o- http://install.perlbrew.pl | sh
+
After that, C<perlbrew> installs itself to C<~/perl5/perlbrew/bin>, and you
should follow the instruction on screen to modify your shell rc file to put it
in your PATH.
View
4 lib/App/perlbrew.pm
@@ -235,6 +235,7 @@ sub min(@) {
my @commands = (
# curl's --fail option makes the exit code meaningful
[qw( curl --silent --location --fail --insecure )],
+ [qw( fetch -o - )],
[qw( wget --no-check-certificate --quiet -O - )],
);
for my $command (@commands) {
@@ -258,6 +259,9 @@ sub min(@) {
die 'Page not retrieved; HTTP error code 400 or above.'
if $command[0] eq 'curl' # Exit code is 22 on 404s etc
and $? >> 8 == 22; # exit code is packed into $?; see perlvar
+ die 'Page not retrieved: fetch failed.'
+ if $command[0] eq 'fetch' # Exit code is not 0 on error
+ and $?;
die 'Server issued an error response.'
if $command[0] eq 'wget' # Exit code is 8 on 404s etc
and $? >> 8 == 8;
View
2  perlbrew-install
@@ -17,6 +17,8 @@ LOCALINSTALLER="perlbrew-$$"
echo
if type curl >/dev/null 2>&1; then
PERLBREWDOWNLOAD="curl -k -f -sS -Lo $LOCALINSTALLER $PERLBREWURL"
+elif type fetch >/dev/null 2>&1; then
+ PERLBREWDOWNLOAD="fetch -o $LOCALINSTALLER $PERLBREWURL"
elif type wget >/dev/null 2>&1; then
PERLBREWDOWNLOAD="wget --no-check-certificate -nv -O $LOCALINSTALLER $PERLBREWURL"
else
Please sign in to comment.
Something went wrong with that request. Please try again.