2012-03-08 18:05:47 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
try () {
|
|
|
|
"$@" || exit -1
|
|
|
|
}
|
|
|
|
|
2012-03-09 02:46:16 +01:00
|
|
|
. $(dirname $0)/environment.sh
|
|
|
|
|
2012-03-08 18:05:47 +01:00
|
|
|
APPNAME=$1
|
|
|
|
APPID=$(echo $APPNAME | tr '[A-Z]' '[a-z]')
|
2012-03-09 02:46:16 +01:00
|
|
|
APPDIR=$KIVYIOSROOT/app-$APPID
|
2012-03-08 18:05:47 +01:00
|
|
|
SRCDIR=$2
|
|
|
|
|
|
|
|
if [ "X$APPNAME" == "X" ]; then
|
|
|
|
echo $(basename $0) "<appname> <source directory>"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "X$SRCDIR" == "X" ]; then
|
|
|
|
echo $(basename $0) "<appname> <source directory>"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "-> Copy $SRCDIR to $APPDIR/YourApp"
|
|
|
|
YOURAPPDIR=$APPDIR/YourApp
|
|
|
|
|
|
|
|
echo "-> Remove any previous YourApp version"
|
2012-07-25 14:07:42 +02:00
|
|
|
if [ -e $YOURAPPDIR ]; then
|
|
|
|
rm -r $YOURAPPDIR
|
|
|
|
fi
|
2012-03-08 18:05:47 +01:00
|
|
|
|
|
|
|
echo "-> Copy the new source"
|
|
|
|
try cp -a $SRCDIR $YOURAPPDIR
|
|
|
|
|
|
|
|
echo "-> Compile to pyo"
|
2012-07-19 01:55:25 +02:00
|
|
|
$TMPROOT/Python-$PYTHON_VERSION/hostpython -OO -m compileall $YOURAPPDIR
|
2012-03-08 18:05:47 +01:00
|
|
|
|
|
|
|
echo "-> Remove unused files (pyc, py)"
|
|
|
|
find $YOURAPPDIR -iname '*.py' -exec rm {} \;
|
|
|
|
find $YOURAPPDIR -iname '*.pyc' -exec rm {} \;
|
|
|
|
|
|
|
|
|
|
|
|
echo "-> Source code of $APPNAME updated."
|
|
|
|
|