All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3 v2] Improve setup scripts
@ 2014-02-24 17:11 Gary Thomas
  2014-02-24 17:11 ` [PATCH 1/3 v2] oe-init-build-env: Improve script sourcing detection Gary Thomas
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Gary Thomas @ 2014-02-24 17:11 UTC (permalink / raw)
  To: openembedded-core; +Cc: Gary Thomas

These changes improve the setup scripts which are initiated
by the user via 'oe-init-build-env'.

Gary Thomas (3):
  This script is only useful when sourced into a shell.  These    
    changes improve the detection of this operation, no matter     how
    the script is referenced.
  Keeping track of the TEMPLATECONF variable in the build     tree will
    let this script produce the same output when     listing
    'conf-notes.txt' every time the script is run,     regardless of
    whether or not TEMPLATECONF has been provided     by the user.
  .templateconf: New file for customized template defaults

 .templateconf             |    2 ++
 oe-init-build-env         |   42 +++++++++++++++++++++++-------------------
 scripts/oe-setup-builddir |   10 +++++++++-
 3 files changed, 34 insertions(+), 20 deletions(-)
 create mode 100644 .templateconf

-- 
1.7.9.5



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

* [PATCH 1/3 v2] oe-init-build-env: Improve script sourcing detection.
  2014-02-24 17:11 [PATCH 0/3 v2] Improve setup scripts Gary Thomas
@ 2014-02-24 17:11 ` Gary Thomas
  2014-02-24 17:11 ` [PATCH 2/3 v2] scripts/oe-setup-builddir: Keep track of TEMPLATECONF setting Gary Thomas
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Gary Thomas @ 2014-02-24 17:11 UTC (permalink / raw)
  To: openembedded-core; +Cc: Gary Thomas

This script is only useful when sourced into a shell. 
These changes improve the detection of this operation,
no matter how the script is referenced.

Signed-off-by: Gary Thomas <gary@mlbassoc.com>
---
 oe-init-build-env |   42 +++++++++++++++++++++++-------------------
 1 file changed, 23 insertions(+), 19 deletions(-)

diff --git a/oe-init-build-env b/oe-init-build-env
index 8ef32f3..5249513 100755
--- a/oe-init-build-env
+++ b/oe-init-build-env
@@ -25,27 +25,31 @@
 # being sourced.   To workaround the shell limitation use "set arg1" prior 
 # to sourcing this script.
 #
-if [ -z "$ZSH_NAME" ] && [ "x$0" = "x./oe-init-build-env" ]; then
-   echo "Error: This script needs to be sourced. Please run as '. ./oe-init-build-env'"
+if [ -n "$BASH_SOURCE" ]; then
+   OEROOT="`dirname $BASH_SOURCE`"
+elif [ -n "$ZSH_NAME" ]; then
+   OEROOT="`dirname $0`"
 else
-   if [ -n "$BASH_SOURCE" ]; then
-      OEROOT="`dirname $BASH_SOURCE`"
-   elif [ -n "$ZSH_NAME" ]; then
-      OEROOT="`dirname $0`"
-   else
-      OEROOT="`pwd`"
-   fi
-   if [ -n "$BBSERVER" ]; then
-      unset BBSERVER
-   fi
-    OEROOT=`readlink -f "$OEROOT"`
-   export OEROOT
-   . $OEROOT/scripts/oe-buildenv-internal && \
-        $OEROOT/scripts/oe-setup-builddir && \
-        [ -n "$BUILDDIR" ] && cd $BUILDDIR
-   unset OEROOT
-   unset BBPATH
+   OEROOT="`pwd`"
 fi
+if [ -n "$BBSERVER" ]; then
+   unset BBSERVER
+fi
+THIS_SCRIPT=$OEROOT/oe-init-build-env
+
+if [ -z "$ZSH_NAME" ] && [ "$0" = "$THIS_SCRIPT" ]; then
+   echo "Error: This script needs to be sourced. Please run as '. $THIS_SCRIPT'"
+   exit 1
+fi
+
+OEROOT=`readlink -f "$OEROOT"`
+export OEROOT
+. $OEROOT/scripts/oe-buildenv-internal && \
+     $OEROOT/scripts/oe-setup-builddir && \
+     [ -n "$BUILDDIR" ] && cd $BUILDDIR
+unset OEROOT
+unset BBPATH
+unset THIS_SCRIPT
 
 # Shutdown any bitbake server if the BBSERVER variable is not set
 if [ -z "$BBSERVER" ] && [ -f bitbake.lock ] ; then
-- 
1.7.9.5



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

* [PATCH 2/3 v2] scripts/oe-setup-builddir: Keep track of TEMPLATECONF setting
  2014-02-24 17:11 [PATCH 0/3 v2] Improve setup scripts Gary Thomas
  2014-02-24 17:11 ` [PATCH 1/3 v2] oe-init-build-env: Improve script sourcing detection Gary Thomas
@ 2014-02-24 17:11 ` Gary Thomas
  2014-02-24 17:11 ` [PATCH 3/3 v2] .templateconf: New file for customized template defaults Gary Thomas
  2014-03-07 13:42 ` [PATCH 0/3 v2] Improve setup scripts Gary Thomas
  3 siblings, 0 replies; 5+ messages in thread
From: Gary Thomas @ 2014-02-24 17:11 UTC (permalink / raw)
  To: openembedded-core; +Cc: Gary Thomas

Keeping track of the TEMPLATECONF variable in the build
tree will let this script produce the same output when
listing 'conf-notes.txt' every time the script is run,
regardless of whether or not TEMPLATECONF has been
provided by the user.

Note that the default value for TEMPLATECONF now comes from
an easily customizable file $OEROOT/.templateconf

Signed-off-by: Gary Thomas <gary@mlbassoc.com>
---
 scripts/oe-setup-builddir |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/scripts/oe-setup-builddir b/scripts/oe-setup-builddir
index a869fdc..e4356f1 100755
--- a/scripts/oe-setup-builddir
+++ b/scripts/oe-setup-builddir
@@ -37,7 +37,15 @@ fi
 
 cd "$BUILDDIR"
 
-TEMPLATECONF=${TEMPLATECONF:-meta/conf}
+if (test -f "$BUILDDIR/conf/templateconf.cfg") then
+    TEMPLATECONF=$(cat $BUILDDIR/conf/templateconf.cfg)
+fi
+
+source $OEROOT/.templateconf
+
+if ! (test -f "$BUILDDIR/conf/templateconf.cfg") then
+    echo "$TEMPLATECONF" >$BUILDDIR/conf/templateconf.cfg
+fi
 
 # 
 # $TEMPLATECONF can point to a directory for the template local.conf & bblayers.conf
-- 
1.7.9.5



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

* [PATCH 3/3 v2] .templateconf: New file for customized template defaults
  2014-02-24 17:11 [PATCH 0/3 v2] Improve setup scripts Gary Thomas
  2014-02-24 17:11 ` [PATCH 1/3 v2] oe-init-build-env: Improve script sourcing detection Gary Thomas
  2014-02-24 17:11 ` [PATCH 2/3 v2] scripts/oe-setup-builddir: Keep track of TEMPLATECONF setting Gary Thomas
@ 2014-02-24 17:11 ` Gary Thomas
  2014-03-07 13:42 ` [PATCH 0/3 v2] Improve setup scripts Gary Thomas
  3 siblings, 0 replies; 5+ messages in thread
From: Gary Thomas @ 2014-02-24 17:11 UTC (permalink / raw)
  To: openembedded-core; +Cc: Gary Thomas

This file will allow easy customization of the build tools,
in particular the default setting of TEMPLATECONF, which
should reduce the need to fiddle with scripts in the future.

Signed-off-by: Gary Thomas <gary@mlbassoc.com>
---
 .templateconf |    2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 .templateconf

diff --git a/.templateconf b/.templateconf
new file mode 100644
index 0000000..0bf5ecf
--- /dev/null
+++ b/.templateconf
@@ -0,0 +1,2 @@
+# Template settings
+TEMPLATECONF=${TEMPLATECONF:-meta/conf}
-- 
1.7.9.5



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

* Re: [PATCH 0/3 v2] Improve setup scripts
  2014-02-24 17:11 [PATCH 0/3 v2] Improve setup scripts Gary Thomas
                   ` (2 preceding siblings ...)
  2014-02-24 17:11 ` [PATCH 3/3 v2] .templateconf: New file for customized template defaults Gary Thomas
@ 2014-03-07 13:42 ` Gary Thomas
  3 siblings, 0 replies; 5+ messages in thread
From: Gary Thomas @ 2014-03-07 13:42 UTC (permalink / raw)
  To: openembedded-core

On 2014-02-24 10:11, Gary Thomas wrote:
> These changes improve the setup scripts which are initiated
> by the user via 'oe-init-build-env'.
> 
> Gary Thomas (3):
>   This script is only useful when sourced into a shell.  These    
>     changes improve the detection of this operation, no matter     how
>     the script is referenced.
>   Keeping track of the TEMPLATECONF variable in the build     tree will
>     let this script produce the same output when     listing
>     'conf-notes.txt' every time the script is run,     regardless of
>     whether or not TEMPLATECONF has been provided     by the user.
>   .templateconf: New file for customized template defaults
> 
>  .templateconf             |    2 ++
>  oe-init-build-env         |   42 +++++++++++++++++++++++-------------------
>  scripts/oe-setup-builddir |   10 +++++++++-
>  3 files changed, 34 insertions(+), 20 deletions(-)
>  create mode 100644 .templateconf
> 

Ping?  Any comments or discussion?

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------


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

end of thread, other threads:[~2014-03-07 13:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-24 17:11 [PATCH 0/3 v2] Improve setup scripts Gary Thomas
2014-02-24 17:11 ` [PATCH 1/3 v2] oe-init-build-env: Improve script sourcing detection Gary Thomas
2014-02-24 17:11 ` [PATCH 2/3 v2] scripts/oe-setup-builddir: Keep track of TEMPLATECONF setting Gary Thomas
2014-02-24 17:11 ` [PATCH 3/3 v2] .templateconf: New file for customized template defaults Gary Thomas
2014-03-07 13:42 ` [PATCH 0/3 v2] Improve setup scripts Gary Thomas

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.