Browse Source

Bugfixes in create_instance and in all runtest process

Yann Weber 7 years ago
parent
commit
8c5a442e7c
4 changed files with 18 additions and 16 deletions
  1. 1
    1
      Makefile.am
  2. 12
    12
      progs/create_instance.sh
  3. 1
    1
      progs/slim/install_model/loader.py
  4. 4
    2
      runtest.sh

+ 1
- 1
Makefile.am View File

@@ -1,5 +1,5 @@
1 1
 SUBDIRS = lodel progs lodelsites
2
-EXTRA_DIST = runtest examples tests runtest.sh debian
2
+EXTRA_DIST = runtest examples tests debian
3 3
 CLEANFILES = runtest
4 4
 
5 5
 lodel2_localstate_DATA =

+ 12
- 12
progs/create_instance.sh View File

@@ -6,11 +6,13 @@ usage() {
6 6
 	exit 1
7 7
 }
8 8
 
9
-cp_loader() {
10
-	loader="${install_tpl}/loader.py"
11
-	cp -Rv $loader $instdir/
9
+loader_update() {
10
+	libdir=$1
11
+	install_tpl=$2
12
+	instdir=$3
13
+	cp -Rv $install_tpl/loader.py $instdir/loader.py
12 14
 	# Adding lib path to loader
13
-	sed -i -E "s#^(LODEL2_LIB_ABS_PATH = )None#\1'$libdir'#" "$loader"
15
+	sed -i -E "s#^(LODEL2_LIB_ABS_PATH = )None#\1'$libdir'#" "$instdir/loader.py"
14 16
 }
15 17
 
16 18
 
@@ -51,6 +53,7 @@ libdir=$(realpath $libdir)
51 53
 install_tpl=$(realpath $install_tpl)
52 54
 em_file=$(realpath $em_file)
53 55
 
56
+echo "LIBDIR : $libdir"
54 57
 
55 58
 if test ! -d $install_tpl
56 59
 then
@@ -63,9 +66,9 @@ conf="$instdir/conf.d/lodel2.ini"
63 66
 
64 67
 if [ $1 = '-u' ]
65 68
 then
66
-	#Update instance
67
-    cp_loader
68
-	exit 0
69
+      #Update instance
70
+      loader_update "$libdir" "$install_tpl" "$instdir"
71
+      exit 0
69 72
 fi
70 73
 
71 74
 if [ -e "$instdir" ]
@@ -84,12 +87,9 @@ cp -Rv $install_tpl/conf.d $instdir/
84 87
 cp -Rv $em_file $instdir/editorial_model.pickle
85 88
 ln -sv $install_tpl/Makefile $instdir/Makefile
86 89
 ln -sv $install_tpl/lodel_admin.py $instdir/lodel_admin.py
87
-ln -sv $libdir/plugins $instdir/plugins
88
-cp_loader
90
+ln -sv $libdir/lodel/plugins $instdir/plugins
91
+loader_update "$libdir" "$install_tpl" "$instdir"
89 92
 
90
-echo "BEGIN LS"
91
-ls -la $instdir
92
-echo "END LS"
93 93
 # Adding instance name to conf
94 94
 sed -i -E "s#^sitename = noname#sitename = $name#" "$conf"
95 95
 

+ 1
- 1
progs/slim/install_model/loader.py View File

@@ -10,7 +10,7 @@ import sys, os, os.path
10 10
 #
11 11
 # Bootstraping
12 12
 #
13
-LODEL2_LIB_ABS_PATH = '/home/yannweb/dev/lodel2/lodel2-git'
13
+LODEL2_LIB_ABS_PATH = None
14 14
 if LODEL2_LIB_ABS_PATH is not None:
15 15
     if not os.path.isdir(LODEL2_LIB_ABS_PATH):
16 16
         print("FATAL ERROR : the LODEL2_LIB_ABS_PATH variable in loader.py is \

+ 4
- 2
runtest.sh View File

@@ -59,8 +59,10 @@ if [ ! -d "$install_model_dir" ]
59 59
 then
60 60
 	install_model_dir="$(dirname $0)/progs/slim/install_model/"
61 61
 fi
62
+libdir=$(realpath "$(dirname $0)")
62 63
 rmdir $testdir
63
-./progs/create_instance test_instance $testdir "$install_model_dir" ./examples/em_test.pickle "$(dirname $0)/lodel"
64
+./progs/create_instance test_instance $testdir "$install_model_dir" ./examples/em_test.pickle "$libdir"
65
+echo ./progs/create_instance test_instance $testdir "$install_model_dir" ./examples/em_test.pickle "$libdir"
64 66
 cp -R examples $testdir
65 67
 cp -R tests $testdir
66 68
 cd $testdir
@@ -70,4 +72,4 @@ make
70 72
 make refresh_plugins
71 73
 $PYTHON loader.py $@
72 74
 
73
-rm -Rf $testdir
75
+#rm -Rf $testdir

Loading…
Cancel
Save