[bitbake-devel] [RFC PATCH 0/1] Save the initial environment

Richard Purdie richard.purdie at linuxfoundation.org
Thu Jul 21 21:22:39 UTC 2011


On Mon, 2011-07-18 at 15:33 -0700, Joshua Lock wrote:
> Both Chris' terminal work and my reparse command will benefit from a saved
> copy of the initial enviornment. The Python docs indicate that the os.environ
> map is captured when the os module is first imported
> http://docs.python.org/library/os.html#os.environ) so this patch adds a
> variable to the bb namespace (bb.initial_environ) that is an early copy of
> the environment.
> 
> I put the variable here so that a) it's easily accessible and b) we can take
> the copy pretty early on.
> 
> Any thoughts on this? Note the RFC prefix. :-)

Sorry I didn't reply earlier.

I'd really this the environment storage to be something we do explicitly
in bin/bitbake alongside:

    # Clear away any spurious environment variables. But don't wipe the
    # environment totally. This is necessary to ensure the correct operation
    # of the UIs (e.g. for DISPLAY, etc.)
    bb.utils.clean_environment()

I'd suggest we create a copy there, then pass it into cooker and its
cooker which actually stores the copy for future reference. We may then
need to find a way to get to that at the metadata level and from the UIs
but what shouldn't be too difficult.

Cheers,

Richard





More information about the bitbake-devel mailing list