]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
toaster: exit or return depending on the mode
authorEd Bartosh <ed.bartosh@linux.intel.com>
Thu, 15 Oct 2015 16:34:17 +0000 (09:34 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 16 Oct 2015 13:07:29 +0000 (14:07 +0100)
When toaster script is sourced 'return' should be used as
using 'exit' will cause script to exit the shell and close terminal
window. If script is called 'exit' should be used. Otherwise shell
will throw and error:
  return: can only `return' from a function or sourced script

Used 'return' or 'exit' depending on the toaster mode using
TOASTER_MANAGED variable.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bin/toaster

index cf93e9fd98931cf04864470832fb72a9643bad29..2c3432c24ae89766d323a3adbcdd52136be05d55 100755 (executable)
@@ -201,7 +201,7 @@ if [ "$TOASTER_CONF" = "" ]; then
 fi
 if [ ! -f $TOASTER_CONF ]; then
     echo "$TOASTER_CONF configuration file not found. set TOASTER_CONF to specify a path"
-    exit 1;
+    [ "$TOASTER_MANAGED" = '1' ] && exit 1 || return 1
 fi
 # this defines the dir toaster will use for
 # 1) clones of layers (in _toaster_clones )