- unified code style on 'glest' start/wrapper script

- more updates for german language file
This commit is contained in:
mnaumann 2010-07-18 17:51:39 +00:00
parent a9b2d55e38
commit a0ba3e42fd

View File

@ -2,29 +2,28 @@
findMissingSO () { findMissingSO () {
LDCONFIG="$1" LDCONFIG="$1"
SO_LINKEDLIBNAME="$2" SO_LINKEDLIBNAME="$2"
SO_LIBLOOKUP1="$3" SO_LIBLOOKUP1="$3"
SO_LIBLOOKUP2="$4" SO_LIBLOOKUP2="$4"
hasSO=`$LDCONFIG -p | grep -m 1 "$SO_LIBLOOKUP1" | cut "-d>" -f2 | cut "-d " -f2` hasSO=`$LDCONFIG -p | grep -m 1 "$SO_LIBLOOKUP1" | cut "-d>" -f2 | cut "-d " -f2`
if [ -n "$hasSO" ]; then if [ -n "$hasSO" ]; then
echo default library [$SO_LINKEDLIBNAME] was found in [$hasSO] echo 'default library ['"$SO_LINKEDLIBNAME"'] was found in ['"$hasSO"']' >&2
else else
echo default library [$SO_LINKEDLIBNAME] is missing, attempting to find and link to a newer version if available... echo 'default library ['"$SO_LINKEDLIBNAME"'] is missing, attempting to find and link to a newer version if available...' >&2
hasSO=`$LDCONFIG -p | grep -m 1 "$SO_LIBLOOKUP2" | cut "-d>" -f2 | cut "-d " -f2`
if [ -n "$hasSO" ]; then
echo 'new library link ['"$hasSO"'] pointed to from ['"$SO_LINKEDLIBNAME"']' >&2
ln -f -s $hasSO $SO_LINKEDLIBNAME
fi
fi
hasSO=`$LDCONFIG -p | grep -m 1 "$SO_LIBLOOKUP2" | cut "-d>" -f2 | cut "-d " -f2` return 0
if [ -n "$hasSO" ]; then
echo new library link [$hasSO] pointed to from [$SO_LINKEDLIBNAME]
ln -f -s $hasSO $SO_LINKEDLIBNAME
fi
fi
return 0
} }
# Library directory # Library directory
LIBDIR="lib" LIBDIR='lib'
# As a first step to determine the absolute path of the directory the game # As a first step to determine the absolute path of the directory the game
# resides in, dereference symlinks to this script and convert relative to # resides in, dereference symlinks to this script and convert relative to
@ -36,87 +35,85 @@ GAMEDIR="`dirname $MYLOCATION`"
# Change to the game dir, and go! # Change to the game dir, and go!
cd $GAMEDIR cd $GAMEDIR
echo gamedir [$GAMEDIR] echo 'gamedir ['"$GAMEDIR"']' >&2
# export game library directory # export game library directory
test -n "${LIBDIR}" && export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${GAMEDIR}/${LIBDIR}" test -n "${LIBDIR}" && export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${GAMEDIR}/${LIBDIR}"
# ensure ldconfig is found (was an issue on OpenSuSE 11.2) # ensure ldconfig is found (was an issue on OpenSuSE 11.2)
echo Looking for LDCONFIG [$LDCONFIG]... >&2 echo 'Looking for LDCONFIG ['"$LDCONFIG"']...' >&2
if [ "$LDCONFIG"'x' = 'x' ] # 'LDCONFIG' environment variable, if set, overrides the following detection if [ "$LDCONFIG"'_' = '_' ]; then # 'LDCONFIG' environment variable, if set, overrides the following detection
then echo 'LDCONFIG environment variable is not set...' >&2
echo 'Looking for LDCONFIG environment var not found...' >&2 if [ `which ldconfig 2>/dev/null` ]; then
if [ `which ldconfig 2>/dev/null` ]
then
LDCONFIG=`which ldconfig 2>/dev/null` LDCONFIG=`which ldconfig 2>/dev/null`
echo 'Found LDCONFIG using which ['"$LDCONFIG"']...' >&2
echo Found LDCONFIG using which [$LDCONFIG]... >&2
else else
if [ -x /sbin/ldconfig ] if [ -x /sbin/ldconfig ]; then
then
LDCONFIG=/sbin/ldconfig LDCONFIG=/sbin/ldconfig
echo Found LDCONFIG in sbin [$LDCONFIG]... >&2 echo 'Found LDCONFIG in /sbin ['"$LDCONFIG"']...' >&2
# optionally add more custom locations using 'elseif' here # optionally add more custom locations using 'elseif' here
else else
echo 'ERROR: Could not find the "ldconfig" command.' >&2 echo 'ERROR: Could not find the "ldconfig" command.' >&2
echo 'Try running "LDCONFIG=`which ldconfig` '"$0"' instead.' >&2 echo 'Please re-run using: "LDCONFIG=/path/to/ldconfig '"$0" >&2
exit 1 exit 1
fi fi
fi fi
else
echo 'Found LDCONFIG environment variable ['"$LDCONFIG"']...' >&2
fi fi
# now deal with the openal library [libopenal.so.0] # now deal with the openal library [libopenal.so.0]
OS_TYPE=`uname -m` OS_TYPE=`uname -m`
# Suse needs its own openAL # OpenSuSE (11.3) needs its own openAL
if [ -f /etc/SuSE-release ]; then if [ -f /etc/SuSE-release -a -f lib/libopenal* ]; then
rm lib/libopenal* rm -f lib/libopenal*
fi fi
OPENAL_LINKEDLIBNAME="libopenal.so.0" OPENAL_LINKEDLIBNAME='libopenal.so.0'
OPENAL_LIBLOOKUP1=${OPENAL_LINKEDLIBNAME} OPENAL_LIBLOOKUP1=${OPENAL_LINKEDLIBNAME}
OPENAL_LIBLOOKUP2="libopenal.so.1" OPENAL_LIBLOOKUP2='libopenal.so.1'
DIRECTFB_LINKEDLIBNAME="libdirectfb-1.0.so.0" DIRECTFB_LINKEDLIBNAME='libdirectfb-1.0.so.0'
DIRECTFB_LIBLOOKUP1=${DIRECTFB_LINKEDLIBNAME} DIRECTFB_LIBLOOKUP1=${DIRECTFB_LINKEDLIBNAME}
DIRECTFB_LIBLOOKUP2="libdirectfb-" DIRECTFB_LIBLOOKUP2='libdirectfb-'
FUSION_LINKEDLIBNAME="libfusion-1.0.so.0" FUSION_LINKEDLIBNAME='libfusion-1.0.so.0'
FUSION_LIBLOOKUP1=${DIRECTFB_LINKEDLIBNAME} FUSION_LIBLOOKUP1=${DIRECTFB_LINKEDLIBNAME}
FUSION_LIBLOOKUP2="libfusion-" FUSION_LIBLOOKUP2='libfusion-'
DIRECT_LINKEDLIBNAME="libdirect-1.0.so.0" DIRECT_LINKEDLIBNAME='libdirect-1.0.so.0'
DIRECT_LIBLOOKUP1=${DIRECT_LINKEDLIBNAME} DIRECT_LIBLOOKUP1=${DIRECT_LINKEDLIBNAME}
DIRECT_LIBLOOKUP2="libdirect-" DIRECT_LIBLOOKUP2='libdirect-'
if [ "$OS_TYPE" = "x86_64" ]; then if [ "$OS_TYPE"'_' = 'x86_64_' ]; then
DIRECTFB_LINKEDLIBNAME="libdirectfb-1.2.so.0" DIRECTFB_LINKEDLIBNAME='libdirectfb-1.2.so.0'
DIRECTFB_LIBLOOKUP1=${DIRECTFB_LINKEDLIBNAME} DIRECTFB_LIBLOOKUP1=${DIRECTFB_LINKEDLIBNAME}
DIRECTFB_LIBLOOKUP2="libdirectfb-" DIRECTFB_LIBLOOKUP2='libdirectfb-'
FUSION_LINKEDLIBNAME="libfusion-1.2.so.0" FUSION_LINKEDLIBNAME='libfusion-1.2.so.0'
FUSION_LIBLOOKUP1=${DIRECTFB_LINKEDLIBNAME} FUSION_LIBLOOKUP1=${DIRECTFB_LINKEDLIBNAME}
FUSION_LIBLOOKUP2="libfusion-" FUSION_LIBLOOKUP2='libfusion-'
DIRECT_LINKEDLIBNAME="libdirect-1.2.so.0" DIRECT_LINKEDLIBNAME='libdirect-1.2.so.0'
DIRECT_LIBLOOKUP1=${DIRECT_LINKEDLIBNAME} DIRECT_LIBLOOKUP1=${DIRECT_LINKEDLIBNAME}
DIRECT_LIBLOOKUP2="libdirect-" DIRECT_LIBLOOKUP2='libdirect-'
fi fi
#if [ "$OS_TYPE" = "x86_64" ]; then #if [ "$OS_TYPE"'_' = 'x86_64_' ]; then
# OPENAL_LIBLOOKUP1="${OPENAL_LIBLOOKUP1} (libc6)" # OPENAL_LIBLOOKUP1="${OPENAL_LIBLOOKUP1}"' (libc6)'
# OPENAL_LIBLOOKUP2="${OPENAL_LIBLOOKUP2} (libc6)" # OPENAL_LIBLOOKUP2="${OPENAL_LIBLOOKUP2}"' (libc6)'
#
# DIRECTFB_LIBLOOKUP1="${DIRECTFB_LIBLOOKUP1} (libc6)" # DIRECTFB_LIBLOOKUP1="${DIRECTFB_LIBLOOKUP1}"' (libc6)'
# DIRECTFB_LIBLOOKUP2="${DIRECTFB_LIBLOOKUP2} (libc6)" # DIRECTFB_LIBLOOKUP2="${DIRECTFB_LIBLOOKUP2}"' (libc6)'
#
# FUSION_LIBLOOKUP1="${FUSION_LIBLOOKUP1} (libc6)" # FUSION_LIBLOOKUP1="${FUSION_LIBLOOKUP1}"' (libc6)'
# FUSION_LIBLOOKUP2="${FUSION_LIBLOOKUP2} (libc6)" # FUSION_LIBLOOKUP2="${FUSION_LIBLOOKUP2}"' (libc6)'
#
# DIRECT_LIBLOOKUP1="${DIRECT_LIBLOOKUP1} (libc6)" # DIRECT_LIBLOOKUP1="${DIRECT_LIBLOOKUP1}"' (libc6)'
# DIRECT_LIBLOOKUP2="${DIRECT_LIBLOOKUP2} (libc6)" # DIRECT_LIBLOOKUP2="${DIRECT_LIBLOOKUP2}"' (libc6)'
#fi #fi
findMissingSO "$LDCONFIG" "$GAMEDIR/$LIBDIR/${OPENAL_LINKEDLIBNAME}" "$OPENAL_LIBLOOKUP1" "$OPENAL_LIBLOOKUP2" findMissingSO "$LDCONFIG" "$GAMEDIR/$LIBDIR/${OPENAL_LINKEDLIBNAME}" "$OPENAL_LIBLOOKUP1" "$OPENAL_LIBLOOKUP2"