Added -k option (must be first) to keep $LOCAL_CONF untouched after a make install

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@66 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 2db9c8e620e6ecaf3c3e3167a53919213dcc9a8d
Former-commit-id: 7b3a5289ea060a6ea6677f68180a71f837e5df7e
This commit is contained in:
pouillot 2008-10-12 19:24:46 +00:00
parent 45b37b87d8
commit 5ce5ca20b5

View file

@ -31,25 +31,34 @@ LOCAL_CONF=$HOME/.torcs-ng
if [ -d $DATADIR ] if [ -d $DATADIR ]
then then
if [ ! -d $LOCAL_CONF ]
then
rm -rf $LOCAL_CONF
mkdir -p $LOCAL_CONF
echo "$LOCAL_CONF created, copying/linking game data"
fi
export LD_LIBRARY_PATH=$LIBDIR/lib:$LD_LIBRARY_PATH
cd $DATADIR cd $DATADIR
if [ -f $LIBDIR/setup_linux.sh ] if [ "$1" != "-k" ] || [ ! -d $LOCAL_CONF ]
then then
/bin/bash $LIBDIR/setup_linux.sh $LOCAL_CONF if [ ! -d $LOCAL_CONF ]
if [ $? -ne 0 ]
then then
rm -rf $LOCAL_CONF
mkdir -p $LOCAL_CONF
echo "Created $LOCAL_CONF"
fi
if [ -f $LIBDIR/setup_linux.sh ]
then
echo "Copying/linking/updating game data"
/bin/bash $LIBDIR/setup_linux.sh $LOCAL_CONF
if [ $? -ne 0 ]
then
exit 1
fi
else
echo "$LIBDIR/setup_linux.sh file does not exist, check your installation"
exit 1 exit 1
fi fi
else
echo "$LIBDIR/setup_linux.sh file does not exist, check your installation"
exit 1
fi fi
if [ "$1" = "-k" ]
then
echo "Kept game data untouched"
shift
fi
export LD_LIBRARY_PATH=$LIBDIR/lib:$LD_LIBRARY_PATH
case $1 in case $1 in
# List the library used # List the library used
-l) shift -l) shift
@ -72,7 +81,8 @@ EOF
;; ;;
-h) -h)
echo "usage: torcs-ng [-l|-d|-e]" echo "usage: torcs-ng [-k] [-l|-d|-e]"
echo " -k keep untouched $LOCAL_CONF, even just after a make install"
echo " -l list the dynamically linked libraries" echo " -l list the dynamically linked libraries"
echo " -d run under gdb and print stack trace on exit" echo " -d run under gdb and print stack trace on exit"
echo " -e display the commands to issue when you want to run under gdb" echo " -e display the commands to issue when you want to run under gdb"