function testSource(){ if test "$0" != "`echo $0 | sed s/setup\.bash//`" ; then # if $0 contains "setup.bash" we've been run... $0 is shellname if sourced. # One exception is zsh has an option to set it temporarily to the script name if test -z "$ZSH_NAME" ; then # we aren't using zsh rb_not_sourced=true fi fi if test -n "$rb_not_sourced" ; then echo " Error: Make sure you source this script, not execute it. Eg:" echo " $ source setup.bash" echo " or" echo " $ . setup.bash" echo " not" echo " $ ./setup.bash" unset rb_not_sourced exit 1 fi if test ! -f setup.bash ; then echo "You must source the script from within the Realistic Books home directory" exit 1 fi } testSource if [ -z $REALISTIC_BOOKS_HOME ] ; then export REALISTIC_BOOKS_HOME=`pwd` RBOS=`uname -s | tr '[A-Z]' '[a-z]'` # check for running bash under cygwin if test "`echo $RBOS | sed 's/cygwin//'`" != "$RBOS" ; then RBOS=windows fi export RBOS export RBHOME_INSTALLED=$REALISTIC_BOOKS_HOME/$RBOS export PATH=$RBHOME_INSTALLED/bin:$RBHOME_INSTALLED/bin/script:$PATH export LD_LIBRARY_PATH=$RBHOME_INSTALLED/lib export DYLD_LIBRARY_PATH=$RBHOME_INSTALLED/lib if [ "x$1" != "xsilent" ] ; then echo "*****" echo "* Your environment is now set up to run Realistic Books" echo "****" fi else if [ "x$1" != "xsilent" ] ; then echo "*****" echo "* Your environment is already set up to run Realistic Books" echo "****" fi fi if [ -e devel.sh ] ; then source devel.sh $* fi