Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
executable file 59 lines (45 sloc) 1.22 KB
#!/bin/sh
if [ "x${PERLBREWURL}" == "x" ]; then
PERLBREWURL=https://raw.githubusercontent.com/gugod/App-perlbrew/master/perlbrew
fi
if [ -z "$TMPDIR" ]; then
if [ -d "/tmp" ]; then
TMPDIR="/tmp"
else
TMPDIR="."
fi
fi
cd $TMPDIR || exit 1
LOCALINSTALLER=$(mktemp perlbrew.XXXXXX)
echo
if type curl >/dev/null 2>&1; then
PERLBREWDOWNLOAD="curl -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 -nv -O $LOCALINSTALLER $PERLBREWURL"
else
echo "Need wget or curl to use $0"
exit 1
fi
clean_exit () {
[ -f $LOCALINSTALLER ] && rm $LOCALINSTALLER
exit $1
}
echo "## Download the latest perlbrew"
$PERLBREWDOWNLOAD || clean_exit 1
echo
echo "## Installing perlbrew"
PERL="/usr/bin/perl"
[ ! -x "$PERL" ] && PERL="/usr/local/bin/perl"
if [ ! -x "$PERL" ]; then
echo "Need /usr/bin/perl or /usr/local/bin/perl to use $0"
clean_exit 1
fi
chmod +x $LOCALINSTALLER
$PERL $LOCALINSTALLER self-install || clean_exit 1
echo "## Installing patchperl"
$PERL $LOCALINSTALLER -f -q install-patchperl || clean_exit 1
echo
echo "## Done."
rm ./$LOCALINSTALLER
Something went wrong with that request. Please try again.