[bitbake-devel] [PATCH 1/4] toaster: use path to the script to guess config path

brian avery avery.brian at gmail.com
Thu Oct 15 16:34:14 UTC 2015


From: Ed Bartosh <ed.bartosh at linux.intel.com>

Used $TOASTER variable(path to the toaster script) instead of
current directory name to get path to the toasterconf.json

This way script should work in both modes and it doesn't depend
on the current directory.

Signed-off-by: Ed Bartosh <ed.bartosh at linux.intel.com>
Signed-off-by: brian avery <avery.brian at gmail.com>
---
 bin/toaster | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/toaster b/bin/toaster
index e976604..75d3390 100755
--- a/bin/toaster
+++ b/bin/toaster
@@ -194,11 +194,11 @@ fi
 # in the local layers that currently prevent using an arbitrary
 # toasterconf.json
 if [ "$TOASTER_CONF" = "" ]; then
-    BIN_DIR=$(dirname -- "$0")
-    export TOASTER_CONF="$BIN_DIR/../../meta-yocto/conf/toasterconf.json"
+    TOASTER_CONF="$(dirname $TOASTER)/../../meta-yocto/conf/toasterconf.json"
+    export TOASTER_CONF=$(python -c "import os; print os.path.realpath('$TOASTER_CONF')")
 fi
 if [ ! -f $TOASTER_CONF ]; then
-    echo "$TOASTER_CONF configuration file not found, exiting..."
+    echo "$TOASTER_CONF configuration file not found. set TOASTER_CONF to specify a path"
     exit 1;
 fi
 # this defines the dir toaster will use for
-- 
1.9.1




More information about the bitbake-devel mailing list