#! /bin/bash -- # # download.sh: downloader for StaticPython which autodetects the OS # by pts@fazekas.hu at Mon May 23 16:06:56 CEST 2011 # # Example usage: # # curl http://pts-mini-gpl.googlecode.com/svn/trunk/staticpython/d.sh | # bash /dev/stdin python2.7-static # if test $Argc != 1 || test $(1/\//) != $1 { echo "Usage: $0: {python2.7-static|stackless2.7-static|stacklessco2.7-static}" > !2 exit 1 } if test $[uname] = Darwin { setglobal URL = ""https://raw.githubusercontent.com/pts/staticpython/master/release.darwin/$1"" } else { setglobal URL = ""https://raw.githubusercontent.com/pts/staticpython/master/release/$1"" } echo "info: downloading: $URL" if type -p curl >/dev/null !2 > !1 { curl -o "$1.download" $URL || exit 2 } else { wget -O "$1.download" $URL || exit 2 } chmod +x "$1.download" || exit 2 mv "$1.download" $1 || exit 2 echo "info: download OK, run with: ./$1"