#!/bin/bash PATH=/opt/kk7ds/bin:/opt/local/bin:/usr/X11/bin:$PATH VERSION="daily-08262011" TARBALL="chirp-${VERSION}.tar.gz" LOCATION=$(dirname ${BASH_SOURCE})"/../Resources/" CHIRP="${LOCATION}/chirp-${VERSION}" echo $LOCATION > /tmp/dan MSG_FIRST=$(cat <$HOME/.chirp/debug.log 2>&1) } fail_if_no_runtime() { NORUNTIME=1; ERRMSG=""; # check kk7ds Python if [ ! -x /opt/kk7ds/bin/python2.5 ]; then ERRMSG=$ERRMSG"The KK7DS Python runtime for OSX is not installed\n" # check macports Python if [ ! -x /opt/local/bin/python2.7 ]; then ERRMSG=$ERRMSG"The Macport Python2.7 runtime for OSX is not installed\n"; else ERRMSG=" "; NORUNTIME=0; RUNPYTHON="/opt/local/bin/python2.7"; if [ -z "`port -q installed py27-gtk`" ]; then ERRMSG=$ERRMSG"The Macport py27-gtk module for OSX is not installed\n"; let "NORUNTIME += 1"; fi if [ -z "`port -q installed py27-libxml2`" ]; then ERRMSG=$ERRMSG"The Macport py27-libxml2 module for OSX is not installed\n"; let "NORUNTIME += 1"; fi if [ -z "`port -q installed py27-serial`" ]; then ERRMSG=$ERRMSG"The Macport py27-serial module for OSX is not installed\n"; let "NORUNTIME += 1"; fi fi else NORUNTIME=0; RUNPYTHON="/opt/kk7ds/bin/python25"; fi if [ $NORUNTIME -gt 0 ]; then echo -e $ERRMSG | xmessage -file -; exit 1 fi } fail_if_no_runtime if [ ! -d "$CHIRP" ]; then echo -e $MSG_FIRST | xmessage -buttons 'OK:0,Cancel:1' -file - if [ $? -ne 0 ]; then exit 1 fi fetch_extract_tarball || { xmessage "Unable to fetch CHIRP ${VERSION}" exit 1 } fi run_chirp || { xmessage "Failed to run CHIRP ${VERSION}" exit 1 }