Browse Source

Bugfixes in create_instance and in all runtest process

Yann Weber 8 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
 SUBDIRS = lodel progs lodelsites
1
 SUBDIRS = lodel progs lodelsites
2
-EXTRA_DIST = runtest examples tests runtest.sh debian
2
+EXTRA_DIST = runtest examples tests debian
3
 CLEANFILES = runtest
3
 CLEANFILES = runtest
4
 
4
 
5
 lodel2_localstate_DATA =
5
 lodel2_localstate_DATA =

+ 12
- 12
progs/create_instance.sh View File

6
 	exit 1
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
 	# Adding lib path to loader
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
 install_tpl=$(realpath $install_tpl)
53
 install_tpl=$(realpath $install_tpl)
52
 em_file=$(realpath $em_file)
54
 em_file=$(realpath $em_file)
53
 
55
 
56
+echo "LIBDIR : $libdir"
54
 
57
 
55
 if test ! -d $install_tpl
58
 if test ! -d $install_tpl
56
 then
59
 then
63
 
66
 
64
 if [ $1 = '-u' ]
67
 if [ $1 = '-u' ]
65
 then
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
 fi
72
 fi
70
 
73
 
71
 if [ -e "$instdir" ]
74
 if [ -e "$instdir" ]
84
 cp -Rv $em_file $instdir/editorial_model.pickle
87
 cp -Rv $em_file $instdir/editorial_model.pickle
85
 ln -sv $install_tpl/Makefile $instdir/Makefile
88
 ln -sv $install_tpl/Makefile $instdir/Makefile
86
 ln -sv $install_tpl/lodel_admin.py $instdir/lodel_admin.py
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
 # Adding instance name to conf
93
 # Adding instance name to conf
94
 sed -i -E "s#^sitename = noname#sitename = $name#" "$conf"
94
 sed -i -E "s#^sitename = noname#sitename = $name#" "$conf"
95
 
95
 

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

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

+ 4
- 2
runtest.sh View File

59
 then
59
 then
60
 	install_model_dir="$(dirname $0)/progs/slim/install_model/"
60
 	install_model_dir="$(dirname $0)/progs/slim/install_model/"
61
 fi
61
 fi
62
+libdir=$(realpath "$(dirname $0)")
62
 rmdir $testdir
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
 cp -R examples $testdir
66
 cp -R examples $testdir
65
 cp -R tests $testdir
67
 cp -R tests $testdir
66
 cd $testdir
68
 cd $testdir
70
 make refresh_plugins
72
 make refresh_plugins
71
 $PYTHON loader.py $@
73
 $PYTHON loader.py $@
72
 
74
 
73
-rm -Rf $testdir
75
+#rm -Rf $testdir

Loading…
Cancel
Save