ocarina/scripts/makebin.sh
Bryan Schumaker 41e08fe248 Ocarina: Start through a function call
I was starting Ocarina through "import ocarina" in the launcher.  This
was apparently a bad idea, since the import lock will never be released.
This lock prevents other threads from importing modules, so when I tried
to use urllib2 to download album art the call blocked until after I
closed Ocarina.
2011-05-07 15:54:26 -04:00

37 lines
546 B
Bash

#!/bin/bash
PYTHONS=`find /usr/bin/python* | grep -v config | grep -v count`
function gen_ocarina()
{
PY=$1
#OUT="bin/ocarina"
#echo "#!/bin/bash" > $OUT
#echo "$PY ocarina.py \$*" >> $OUT
#chmod +x $OUT
OUT="ocarina.py"
echo "#!$PY" > $OUT
echo "import ocarina" >> $OUT
echo "ocarina.run()" >> $OUT
chmod +x $OUT
}
function gen_bin()
{
PY=$1
gen_ocarina $PY
echo ""
}
for PY in $PYTHONS
do
$PY -c "import gst" 2>/dev/null 1>/dev/null
if [ "$?" == "0" ]
then
echo "Found python version: $PY"
gen_bin $PY
break
fi
done