summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2015-12-17 16:48:50 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-18 13:51:54 +0000
commitaf34920dff0fcaa125f02c2db7a22ecd56aba29e (patch)
tree6f5ba1a7d277f99d60c68a98d378b8df25de5b02
parent563b786d4b4e565d6915384dfeef7d8c0bccb907 (diff)
downloadpoky-af34920dff0fcaa125f02c2db7a22ecd56aba29e.tar.gz
bitbake: toaster: add MANAGE variable
Used MANAGE variable to avoid repeating path to manage.py in many places in toaster script. (Bitbake rev: e8e19168ff43b72a2481771e7a40d9d7c155cfd2) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xbitbake/bin/toaster13
1 files changed, 7 insertions, 6 deletions
diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster
index ccbfdb30b0..087e3f92d6 100755
--- a/bitbake/bin/toaster
+++ b/bitbake/bin/toaster
@@ -57,14 +57,14 @@ webserverStartAll()
57 retval=0 57 retval=0
58 # you can always add a superuser later via 58 # you can always add a superuser later via
59 # ../bitbake/lib/toaster/manage.py createsuperuser --username=<ME> 59 # ../bitbake/lib/toaster/manage.py createsuperuser --username=<ME>
60 python $BBBASEDIR/lib/toaster/manage.py migrate --noinput || retval=1 60 $MANAGE migrate --noinput || retval=1
61 61
62 if [ $retval -eq 1 ]; then 62 if [ $retval -eq 1 ]; then
63 echo "Failed migrations, aborting system start" 1>&2 63 echo "Failed migrations, aborting system start" 1>&2
64 return $retval 64 return $retval
65 fi 65 fi
66 66
67 python $BBBASEDIR/lib/toaster/manage.py checksettings --traceback || retval=1 67 $MANAGE checksettings --traceback || retval=1
68 68
69 if [ $retval -eq 1 ]; then 69 if [ $retval -eq 1 ]; then
70 printf "\nError while checking settings; aborting\n" 70 printf "\nError while checking settings; aborting\n"
@@ -73,7 +73,7 @@ webserverStartAll()
73 73
74 echo "Starting webserver..." 74 echo "Starting webserver..."
75 75
76 python $BBBASEDIR/lib/toaster/manage.py runserver "0.0.0.0:$WEB_PORT" \ 76 $MANAGE runserver "0.0.0.0:$WEB_PORT" \
77 </dev/null >>${BUILDDIR}/toaster_web.log 2>&1 \ 77 </dev/null >>${BUILDDIR}/toaster_web.log 2>&1 \
78 & echo $! >${BUILDDIR}/.toastermain.pid 78 & echo $! >${BUILDDIR}/.toastermain.pid
79 79
@@ -130,7 +130,7 @@ start_bitbake() {
130 return 1 130 return 1
131 fi 131 fi
132 export BBSERVER=0.0.0.0:-1 132 export BBSERVER=0.0.0.0:-1
133 export DATABASE_URL=`$BBBASEDIR/lib/toaster/manage.py get-dburl` 133 export DATABASE_URL=`$MANAGE get-dburl`
134 # we start the TOASTERUI only if not inhibited 134 # we start the TOASTERUI only if not inhibited
135 if [ $NOTOASTERUI -eq 0 ]; then 135 if [ $NOTOASTERUI -eq 0 ]; then
136 bitbake --observe-only -u toasterui --remote-server=$BBSERVER -t xmlrpc \ 136 bitbake --observe-only -u toasterui --remote-server=$BBSERVER -t xmlrpc \
@@ -184,6 +184,7 @@ else
184fi 184fi
185 185
186BBBASEDIR=`dirname $TOASTER`/.. 186BBBASEDIR=`dirname $TOASTER`/..
187MANAGE=$BBBASEDIR/lib/toaster/manage.py
187OEROOT=`dirname $TOASTER`/../.. 188OEROOT=`dirname $TOASTER`/../..
188NOTOASTERUI=0 189NOTOASTERUI=0
189WEBSERVER=1 190WEBSERVER=1
@@ -316,7 +317,7 @@ echo "The system will $CMD."
316 317
317# check if addr:port is not in use 318# check if addr:port is not in use
318if [ "$CMD" == 'start' ]; then 319if [ "$CMD" == 'start' ]; then
319 python $BBBASEDIR/lib/toaster/manage.py checksocket "0.0.0.0:$WEB_PORT" || return 1 320 $MANAGE checksocket "0.0.0.0:$WEB_PORT" || return 1
320fi 321fi
321 322
322# Make sure it's safe to run by checking bitbake lock 323# Make sure it's safe to run by checking bitbake lock
@@ -351,7 +352,7 @@ case $CMD in
351 fi 352 fi
352 start_bitbake 353 start_bitbake
353 if [ $? -eq 0 ]; then 354 if [ $? -eq 0 ]; then
354 python $BBBASEDIR/lib/toaster/manage.py runbuilds & echo $! >${BUILDDIR}/.runbuilds.pid 355 $MANAGE runbuilds & echo $! >${BUILDDIR}/.runbuilds.pid
355 # set fail safe stop system on terminal exit 356 # set fail safe stop system on terminal exit
356 trap stop_system SIGHUP 357 trap stop_system SIGHUP
357 echo "Successful ${CMD}." 358 echo "Successful ${CMD}."