[bitbake-devel] [PATCH 1/1] bitbake: implement BB_VERBOSE_LOGS

Richard Purdie richard.purdie at linuxfoundation.org
Mon Feb 27 16:04:17 UTC 2012


On Mon, 2012-02-27 at 14:11 +0000, Paul Eggleton wrote:
> Enable configuring whether "set +x" is added to all shell tasks rather
> than forcing it; this is enabled by setting BB_VERBOSE_LOGS to 1.
> 
> Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
> ---
>  bitbake/lib/bb/build.py  |    3 ++-
>  bitbake/lib/bb/cooker.py |    4 ++++
>  bitbake/lib/bb/msg.py    |    3 +++
>  3 files changed, 9 insertions(+), 1 deletions(-)
> 
> diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
> index e85d7c4..37686f8 100644
> --- a/bitbake/lib/bb/build.py
> +++ b/bitbake/lib/bb/build.py
> @@ -221,9 +221,10 @@ def exec_func_shell(function, d, runfile, cwd=None):
>  
>      with open(runfile, 'w') as script:
>          script.write('#!/bin/sh -e\n')
> +        if bb.msg.loggerVerboseLogs:
> +            script.write("set -x\n")
>          data.emit_func(function, script, d)
>  
> -        script.write("set -x\n")
>          if cwd:
>              script.write("cd %s\n" % cwd)

Looks good to me but could I suggest one small tweak - position the set
-x after data.emit_func()?

The reason being that having lines of output for each line in the run.*
file is generally painful and it makes more sense to start tracing only
when we start executing the function we care about.

Cheers,

Richard





More information about the bitbake-devel mailing list