All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] toaster: determine toasterconf.json from TEMPLATECONF
@ 2015-11-05 18:49 brian avery
  2015-11-05 18:50 ` [PATCH 1/1] toaster: change toasterconf.json logic to use TEMPLATECONF like oe-setup-builddir brian avery
  0 siblings, 1 reply; 2+ messages in thread
From: brian avery @ 2015-11-05 18:49 UTC (permalink / raw)
  To: toaster

This changes our method of picking the correct toasterconf.json file to use
TEMPLATECONF which is found in the .templateconf file.  This is in line
with how the oe-setup-builddir script does it.

-b

The following changes since commit fc45deac89ef63ca1c44e763c38ced7dfd72cbe1:

  build-appliance-image: Update to jethro head revision (2015-11-03 14:03:03 +0000)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib bavery/toaster/oeFriendlyToasterconf
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=bavery/toaster/oeFriendlyToasterconf

brian avery (1):
  toaster: change toasterconf.json logic to use TEMPLATECONF like
    oe-setup-builddir

 bin/toaster | 33 ++++++++++++++++++++++++---------
 1 file changed, 24 insertions(+), 9 deletions(-)

--
1.9.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/1] toaster: change toasterconf.json logic to use TEMPLATECONF like oe-setup-builddir
  2015-11-05 18:49 [PATCH 0/1] toaster: determine toasterconf.json from TEMPLATECONF brian avery
@ 2015-11-05 18:50 ` brian avery
  0 siblings, 0 replies; 2+ messages in thread
From: brian avery @ 2015-11-05 18:50 UTC (permalink / raw)
  To: toaster

This changes the way we pick a toasterconf.json file to match the way
oe-setup-builddir does. We now base it on TEMPLATECONF found in
the .templateconf file.

Signed-off-by: brian avery <avery.brian@gmail.com>
---
 bin/toaster | 33 ++++++++++++++++++++++++---------
 1 file changed, 24 insertions(+), 9 deletions(-)

diff --git a/bin/toaster b/bin/toaster
index 2c3432c..1eb74e1 100755
--- a/bin/toaster
+++ b/bin/toaster
@@ -179,6 +179,7 @@ fi
 [ `basename \"$0\"` = `basename \"${TOASTER}\"` ] && TOASTER_MANAGED=1
 
 BBBASEDIR=`dirname $TOASTER`/..
+OEROOT=`dirname $TOASTER`/../..
 
 RUNNING=0
 
@@ -189,18 +190,33 @@ if [ "$WEB_PORT" = "" ]; then
     WEB_PORT="8000"
 fi
 # this is the configuraton file we are using for toaster
-# note default is assuming yocto. Override this if you are
-# running in a pure OE environment and use the toasterconf.json
-# in meta/conf/toasterconf.json
-# note: for future there are a number of relative path assumptions
-# in the local layers that currently prevent using an arbitrary
-# toasterconf.json
+# we are using the same logic that oe-setup-builddir uses
+# basesd on TEMPLATECONF and .templateconf to determine
+# which toasterconf.json to use.
+# note: There are a number of relative path assumptions
+# in the local layers that currently make using an arbitrary
+# toasterconf.json difficult.
+
+. $OEROOT/.templateconf
+if [ -n "$TEMPLATECONF" ]; then
+    if [ ! -d "$TEMPLATECONF" ]; then
+        # Allow TEMPLATECONF=meta-xyz/conf as a shortcut
+        if [ -d "$OEROOT/$TEMPLATECONF" ]; then
+            TEMPLATECONF="$OEROOT/$TEMPLATECONF"
+        fi
+        if [ ! -d "$TEMPLATECONF" ]; then
+            echo >&2 "Error: '$TEMPLATECONF' must be a directory containing toasterconf.json"
+	    [ "$TOASTER_MANAGED" = '1' ] && exit 1 || return 1
+        fi
+    fi
+fi
+
 if [ "$TOASTER_CONF" = "" ]; then
-    TOASTER_CONF="$(dirname $TOASTER)/../../meta-yocto/conf/toasterconf.json"
+    TOASTER_CONF="$TEMPLATECONF/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. set TOASTER_CONF to specify a path"
+    echo "$TOASTER_CONF configuration file not found. Set TOASTER_CONF to specify file or fix .templateconf"
     [ "$TOASTER_MANAGED" = '1' ] && exit 1 || return 1
 fi
 # this defines the dir toaster will use for
@@ -395,4 +411,3 @@ case $CMD in
         echo "Successful ${CMD}."
     ;;
 esac
-
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-11-05 18:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-05 18:49 [PATCH 0/1] toaster: determine toasterconf.json from TEMPLATECONF brian avery
2015-11-05 18:50 ` [PATCH 1/1] toaster: change toasterconf.json logic to use TEMPLATECONF like oe-setup-builddir brian avery

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.