Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 42 lines (34 sloc) 1.287 kb
#! /bin/sh
set -e
if [ "$SPKG_LOCAL" = "" ]; then
echo "SPKG_LOCAL undefined ... exiting";
exit 1
fi
PACKAGE_NAME=onlinelab
CONFIG_DIR="$SPKG_LOCAL/share/onlinelab/"
# remove old install:
rm -rf $SPKG_LOCAL/lib/python/site-packages/onlinelab
CONFIG_DIR_BACKUP=`mktemp -d --tmpdir=$SPKG_LOCAL/share/`
mkdir -p $CONFIG_DIR
mv $CONFIG_DIR $CONFIG_DIR_BACKUP/
echo "Old data are stored in: $CONFIG_DIR_BACKUP"
# install online lab
cp -pr onlinelab $SPKG_LOCAL/lib/python/site-packages/
cp bin/onlinelab $SPKG_LOCAL/bin
mkdir -p $CONFIG_DIR
cp -r ui $CONFIG_DIR/
# init the online lab
CUR=`pwd`
cd $SPKG_LOCAL #to make sure the right lab gets imported
onlinelab core init --home=$CONFIG_DIR/core-home --ui-path=$CONFIG_DIR/ui
onlinelab service init --home=$CONFIG_DIR/service-home
# allow to pass the os.environ into the engine Python process (so that
# LD_LIBRARY_PATH and other things are properly set):
echo "ENVIRON = True" >> $CONFIG_DIR/service-home/settings.py
# Try to copy the data from the old installation:
if [ -f "$CONFIG_DIR_BACKUP/onlinelab/core-home/onlinelab.db" ]; then
echo "Copying old database into the new lab"
cp "$CONFIG_DIR_BACKUP/onlinelab/core-home/onlinelab.db" $CONFIG_DIR/core-home/
else
echo "No old database found, nothing copied."
fi
Jump to Line
Something went wrong with that request. Please try again.