Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

detect version of erlang in boot script and rebuild them if needed

SVN Revision: 554
  • Loading branch information...
commit 0964e946011269bd757095dba4cfef2a8fea3300 1 parent ffbf528
Nicolas Niclausse nniclausse authored

Showing 2 changed files with 37 additions and 0 deletions. Show diff stats Hide diff stats

  1. +7 0 Makefile.in
  2. +30 0 idx-tsunami.sh.in
7 Makefile.in
@@ -110,6 +110,9 @@ BUILD_OPTIONS = '[{systools, \
110 110 }]}, \
111 111 {sh_script, none}, \
112 112 {make_app, true }, {make_rel, true}].'
  113 +
  114 +BUILD_OPTIONS_DOT = $(subst $(PWD)/temp/,./,$(BUILD_OPTIONS))
  115 +
113 116 BUILD_OPTIONS_FILE = ./BUILD_OPTIONS
114 117
115 118 DIST_COMMON=Makefile.in $(CONFFILE_SRC) $(PERL_SCRIPTS_SRC) idx-tsunami.sh.in idx-tsunami.spec.in
@@ -155,11 +158,13 @@ install: doc boot install_recorder install_controller $(CONFFILE)
155 158
156 159 cp $(INC_FILES) $(TARGETDIR)/include
157 160 cp $(TARGET) $(TARGETDIR)/ebin
  161 + cp builder.beam $(TARGETDIR)/ebin
158 162
159 163 cp $(TGT_APPFILES_E) $(TARGETDIR)/ebin
160 164 cp $(TGT_APPFILES_P) $(TARGETDIR)/priv
161 165
162 166 cp $(SRC) $(SRC_APPFILES) $(TARGETDIR)/src
  167 + echo $(BUILD_OPTIONS_DOT) > $(TARGETDIR)/BUILD_OPTIONS
163 168
164 169 # install the man page & user's manual
165 170 install -d $(MAN_DIR)
@@ -192,6 +197,7 @@ install_recorder:
192 197 cp $(RECORDER_TGT_APPFILES_P) $(RECORDER_TARGETDIR)/priv
193 198
194 199 cp $(RECORDER_SRC) $(RECORDER_SRC_APPFILES) $(RECORDER_TARGETDIR)/src
  200 + echo $(BUILD_OPTIONS_DOT) > $(RECORDER_TARGETDIR)/BUILD_OPTIONS
195 201
196 202 install_controller:
197 203 install -d $(CONTROLLER_TARGETDIR)/priv
@@ -205,6 +211,7 @@ install_controller:
205 211 cp $(CONTROLLER_TGT_APPFILES_P) $(CONTROLLER_TARGETDIR)/priv
206 212
207 213 cp $(CONTROLLER_SRC) $(CONTROLLER_SRC_APPFILES) $(CONTROLLER_TARGETDIR)/src
  214 + echo $(BUILD_OPTIONS_DOT) > $(CONTROLLER_TARGETDIR)/BUILD_OPTIONS
208 215
209 216 uninstall:
210 217 rm -rf $(TARGETDIR) $(SCRIPT)
30 idx-tsunami.sh.in
@@ -30,6 +30,8 @@ REC_DEBUG_LEVEL=5
30 30 ERL_RSH=" -rsh ssh "
31 31 ERL_OPTS=" +A 1 @ERL_OPTS@ "
32 32 COOKIE='tsunami'
  33 +ERTS_RUN=`$ERL -version 2>&1 | tr -d '[A-Za-z] (),\f\n\r'`
  34 +ERTS_BOOT=`grep erts $TSUNAMIPATH/../priv/tsunami.rel | tr -d 'a-z{}"" ,\n'`
33 35
34 36 stop() {
35 37 $ERL $ERL_OPTS $ERL_RSH -noshell -sname killer -setcookie $COOKIE -pa $TSUNAMIPATH -pa $CONTROLLERPATH -s tsunami_controller stop_all $HOST -s init stop
@@ -39,6 +41,27 @@ stop_recorder() {
39 41 $ERL $ERL_OPTS $ERL_RSH -noshell -sname killer -setcookie $COOKIE -pa $TSUNAMIPATH -pa $RECORDERPATH -s tsunami_recorder stop_all $HOST -s init stop
40 42 }
41 43
  44 +checkversion() {
  45 + if [ $ERTS_RUN != $ERTS_BOOT ]
  46 + then
  47 + echo "Erlang version has changed ! [$ERTS_BOOT] != [$ERTS_RUN]"
  48 + echo "Must create new boot files (you may have to run this once as root ! )"
  49 + makebootfiles
  50 + fi
  51 +}
  52 +
  53 +makebootfiles() {
  54 + cd $TSUNAMIPATH/..
  55 + echo "creating boot file for tsunami application"
  56 + $ERL $ERL_OPTS -noshell -pa $TSUNAMIPATH -s builder go -s init stop > /dev/null
  57 + cd $CONTROLLERPATH/..
  58 + echo "creating boot file for tsunami_controller application"
  59 + $ERL $ERL_OPTS -noshell -pa $TSUNAMIPATH -s builder go -s init stop > /dev/null
  60 + echo "creating boot file for tsunami_recorder application"
  61 + cd $RECORDERPATH/..
  62 + $ERL $ERL_OPTS -noshell -pa $TSUNAMIPATH -s builder go -s init stop > /dev/null
  63 +}
  64 +
42 65 start() {
43 66 echo "Starting IDX-Tsunami"
44 67 $ERL $ERL_OPTS $ERL_RSH -noshell -sname $CONTROLLER -setcookie $COOKIE $BOOT_OPT \
@@ -116,19 +139,26 @@ shift $(($OPTIND - 1))
116 139 case $1 in
117 140 start)
118 141 checkconfig
  142 + checkversion
119 143 maindir
120 144 logdir
121 145 start
122 146 ;;
123 147
124 148 recorder)
  149 + checkversion
125 150 maindir
126 151 logdir
127 152 recorder
128 153 ;;
129 154
  155 + boot)
  156 + checkversion
  157 + ;;
  158 +
130 159 debug)
131 160 checkconfig
  161 + checkversion
132 162 maindir
133 163 logdir
134 164 debug

0 comments on commit 0964e94

Please sign in to comment.
Something went wrong with that request. Please try again.