[bitbake-devel] [PATCH] bitbake: main: add 2 environment variables

Richard Purdie richard.purdie at linuxfoundation.org
Tue Apr 19 19:58:56 UTC 2016


On Tue, 2016-04-19 at 17:30 +0300, Ed Bartosh wrote:
> Bitbake uses set of environment variables to set command line
> options, e.g. seeting BBTOKEN variable has the same effect
> as using --token command line option.
> 
> Added new environment variables BBPRECONF and BBPOSTCONF that
> are equivalents of --read and --postread command line options.
> They can be used by high level scripts to append or prepend
> configuration files to conf/local.conf
> 
> [YOCTO #9235]
> 
> Signed-off-by: Ed Bartosh <ed.bartosh at linux.intel.com>
> ---
>  bitbake/lib/bb/main.py | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/bitbake/lib/bb/main.py b/bitbake/lib/bb/main.py
> index e302173..1dd7877 100755
> --- a/bitbake/lib/bb/main.py
> +++ b/bitbake/lib/bb/main.py
> @@ -250,6 +250,12 @@ class
> BitBakeConfigParameters(cookerdata.ConfigParameters):
>          if "BBEVENTLOG" in os.environ:
>              options.writeeventlog = os.environ["BBEVENTLOG"]
>  
> +        if "BBPRECONF" in os.environ:
> +            option.prefile = os.environ["BBPRECONF"]
> +
> +        if "BBPOSTCONF" in os.environ:
> +            option.postfile = os.environ["BBPOSTCONF"]
> +

I think for principle of least surprise the commandline should override
the environment, append to the environment (but then which order?) or
it should just error and tell the user if they specify both the
commandline and environment options at the same time.

Cheers,

Richard



More information about the bitbake-devel mailing list