diff --git a/Makefile.am b/Makefile.am index 8b8586f..eb00f45 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,5 @@ SUBDIRS = lodel progs lodelsites -EXTRA_DIST = runtest examples tests runtest.sh debian +EXTRA_DIST = runtest examples tests debian CLEANFILES = runtest lodel2_localstate_DATA = diff --git a/progs/create_instance.sh b/progs/create_instance.sh index 059536c..1e18cda 100755 --- a/progs/create_instance.sh +++ b/progs/create_instance.sh @@ -6,11 +6,13 @@ usage() { exit 1 } -cp_loader() { - loader="${install_tpl}/loader.py" - cp -Rv $loader $instdir/ +loader_update() { + libdir=$1 + install_tpl=$2 + instdir=$3 + cp -Rv $install_tpl/loader.py $instdir/loader.py # Adding lib path to loader - sed -i -E "s#^(LODEL2_LIB_ABS_PATH = )None#\1'$libdir'#" "$loader" + sed -i -E "s#^(LODEL2_LIB_ABS_PATH = )None#\1'$libdir'#" "$instdir/loader.py" } @@ -51,6 +53,7 @@ libdir=$(realpath $libdir) install_tpl=$(realpath $install_tpl) em_file=$(realpath $em_file) +echo "LIBDIR : $libdir" if test ! -d $install_tpl then @@ -63,9 +66,9 @@ conf="$instdir/conf.d/lodel2.ini" if [ $1 = '-u' ] then - #Update instance - cp_loader - exit 0 + #Update instance + loader_update "$libdir" "$install_tpl" "$instdir" + exit 0 fi if [ -e "$instdir" ] @@ -84,12 +87,9 @@ cp -Rv $install_tpl/conf.d $instdir/ cp -Rv $em_file $instdir/editorial_model.pickle ln -sv $install_tpl/Makefile $instdir/Makefile ln -sv $install_tpl/lodel_admin.py $instdir/lodel_admin.py -ln -sv $libdir/plugins $instdir/plugins -cp_loader +ln -sv $libdir/lodel/plugins $instdir/plugins +loader_update "$libdir" "$install_tpl" "$instdir" -echo "BEGIN LS" -ls -la $instdir -echo "END LS" # Adding instance name to conf sed -i -E "s#^sitename = noname#sitename = $name#" "$conf" diff --git a/progs/slim/install_model/loader.py b/progs/slim/install_model/loader.py index eb05399..c6ff770 100644 --- a/progs/slim/install_model/loader.py +++ b/progs/slim/install_model/loader.py @@ -10,7 +10,7 @@ import sys, os, os.path # # Bootstraping # -LODEL2_LIB_ABS_PATH = '/home/yannweb/dev/lodel2/lodel2-git' +LODEL2_LIB_ABS_PATH = None if LODEL2_LIB_ABS_PATH is not None: if not os.path.isdir(LODEL2_LIB_ABS_PATH): print("FATAL ERROR : the LODEL2_LIB_ABS_PATH variable in loader.py is \ diff --git a/runtest.sh b/runtest.sh index fd47e49..594af2c 100755 --- a/runtest.sh +++ b/runtest.sh @@ -59,8 +59,10 @@ if [ ! -d "$install_model_dir" ] then install_model_dir="$(dirname $0)/progs/slim/install_model/" fi +libdir=$(realpath "$(dirname $0)") rmdir $testdir -./progs/create_instance test_instance $testdir "$install_model_dir" ./examples/em_test.pickle "$(dirname $0)/lodel" +./progs/create_instance test_instance $testdir "$install_model_dir" ./examples/em_test.pickle "$libdir" +echo ./progs/create_instance test_instance $testdir "$install_model_dir" ./examples/em_test.pickle "$libdir" cp -R examples $testdir cp -R tests $testdir cd $testdir @@ -70,4 +72,4 @@ make make refresh_plugins $PYTHON loader.py $@ -rm -Rf $testdir +#rm -Rf $testdir