Skip to content

Commit

Permalink
reapplied the parts from commit 54a71fb
Browse files Browse the repository at this point in the history
that should be safe
  • Loading branch information
ivanovic committed Feb 25, 2012
1 parent 16bf557 commit 6e02478
Showing 1 changed file with 51 additions and 4 deletions.
55 changes: 51 additions & 4 deletions pandora/pnd/snes.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,42 @@
#!/bin/bash

# This part of the script is meant to test for the available OS version. It does allow
# checking for the exact version number of the currently installed OS and this
# way some filtering for an available feature in an installed lib (like libSDL)
# can be checked more easily.

REQUIRED_MAJOR=1
REQUIRED_MINOR=7
REQUIRED_RELEASE=0
REQUIRED_BUILD=0

REQUIRED_VERSION_FOUND="no"

OS_MAJOR=`cat /etc/op-version | grep -e "^Version" | cut -d " " -f 2 | cut -d "." -f 1`
OS_MINOR=`cat /etc/op-version | grep -e "^Version" | cut -d " " -f 2 | cut -d "." -f 2`
OS_RELEASE=`cat /etc/op-version | grep -e "^Version" | cut -d " " -f 2 | cut -d "." -f 3`
OS_BUILD=`cat /etc/op-version | grep -e "^Version" | cut -d " " -f 2 | cut -d "." -f 4`

if [ "$REQUIRED_MAJOR" -lt "$OS_MAJOR" ]
then
REQUIRED_VERSION_FOUND="yes"
elif [ "$REQUIRED_MAJOR" -eq "$OS_MAJOR" ] && [ $REQUIRED_MINOR -lt $OS_MINOR ]
then
REQUIRED_VERSION_FOUND="yes"
elif [ "$REQUIRED_MAJOR" -eq "$OS_MAJOR" ] && [ $REQUIRED_MINOR -eq $OS_MINOR ] && [ $REQUIRED_RELEASE -lt $OS_RELEASE ]
then
REQUIRED_VERSION_FOUND="yes"
elif [ "$REQUIRED_MAJOR" -eq "$OS_MAJOR" ] && [ $REQUIRED_MINOR -eq $OS_MINOR ] && [ $REQUIRED_RELEASE -eq $OS_RELEASE ] && [ $REQUIRED_BUILD -lt $OS_BUILD ]
then
REQUIRED_VERSION_FOUND="yes"
fi

echo "found at least HF7: "$REQUIRED_VERSION_FOUND

#
# Everything below this is the normal snes9x startup script (which uses the var
# from above).
#

echo "ROM filename is $1"

Expand Down Expand Up @@ -39,11 +76,21 @@ then
#the extracted name is without the internal PATH of the archive, so strip away this part!
FILENAME=`echo $FILEITEM | sed -e "s,^.*/,,g"`
FILENAME="/tmp/$FILENAME"
# LD_LIBRARY_PATH=lib/:$LD_LIBRARY_PATH ./snes9x $ARGS "$FILENAME"
LD_PRELOAD=lib/libSDL-1.2.so.0 ./snes9x $ARGS "$FILENAME"
if [ "$REQUIRED_VERSION_FOUND" -eq "no" ]
then
# LD_LIBRARY_PATH=lib/:$LD_LIBRARY_PATH ./snes9x $ARGS "$FILENAME"
LD_PRELOAD=lib/libSDL-1.2.so.0 ./snes9x $ARGS "$FILENAME"
else
./snes9x $ARGS "$FILENAME"
fi
rm "$FILENAME"
fi
else
# LD_LIBRARY_PATH=lib/:$LD_LIBRARY_PATH ./snes9x $ARGS "$1"
LD_PRELOAD=lib/libSDL-1.2.so.0 ./snes9x $ARGS "$1"
if [ "$REQUIRED_VERSION_FOUND" -eq "no" ]
then
# LD_LIBRARY_PATH=lib/:$LD_LIBRARY_PATH ./snes9x $ARGS "$1"
LD_PRELOAD=lib/libSDL-1.2.so.0 ./snes9x $ARGS "$1"
else
./snes9x $ARGS "$1"
fi
fi

0 comments on commit 6e02478

Please sign in to comment.