Skip to content

Instantly share code, notes, and snippets.

@waffle2k
Created November 19, 2012 21:53
Show Gist options
  • Save waffle2k/4114281 to your computer and use it in GitHub Desktop.
Save waffle2k/4114281 to your computer and use it in GitHub Desktop.
Install the latest package given the script get_latest.pl exists
#!/bin/bash
#
#
function die
{
echo "$1"
exit 1
}
get_latest.pl $1 |
while read PACKAGE
do
cd /tmp
wget $PACKAGE || die 'Could not get package'
FN=$(echo $PACKAGE | awk -F\/ '{print $NF}')
tar zxpvf $FN
D=$(echo $FN | awk -F '.tar.gz' '{print $1}')
cd $D || die "Could not cd to $D"
perl Makefile.PL && sudo make install
cd ..
sudo rm -rf $FN $D
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment