[bitbake-devel] how easy to extend "bitbake -e" to print *selected* subset of variables?

Chris Larson clarson at kergoth.com
Thu Nov 22 23:10:15 UTC 2012


On Thu, Nov 22, 2012 at 1:43 PM, Robert P. J. Day <rpjday at crashcourse.ca>wrote:

> On Thu, 22 Nov 2012, Chris Larson wrote:
>
> > I would personally like to see something like:
> >
> > bitbake -E MACHINE,DISTRO,TMPDIR
> >
> > Rather than having to define additional 'grouping' metadata.
> >
> > For now, something like this might be convenient:
> >
> > $ cat ~/bin/bitbake-env
> > #!/bin/sh
> > #
> > # bitbake-env VARIABLE [VARIBLE...]
> > #
> > # Filter out particular variables from bitbake -e, including the
> commented out
> > # unexpanded form, and both exported and unexported.
> >
> > args_pattern () {
> >     for arg; do
> >         printf "$arg|"
> >     done | sed 's,|$,,'
> > }
> >
> > bitbake -e | grep -E "^((export )?|(# )?)($(args_pattern "$@"))="
>
>   ok, but there's still something i'm missing.  from
> linux-yocto_3.4.bb, i might want to see the final value of
> LINUX_VERSION, but that's not printed as part of the normal
> environment, so i'm assuming i'd need to export it first, right?
> because there's a lot of content i'd be interested in seeing that is
> currently not printed by "bitbake -e".


Yeah, that quick script just ran bitbake -e, not bitbake -e <provider>. You
could modify it easily enough to support that, though.

You could also try out https://gist.github.com/4133101. It's just a quick
prototype. Drop it next to bitbake in bitbake/bin/. It fixes a couple minor
annoyances with bitbake -e and it sends all the bitbake log output from
stdout to stderr, so you can redirect that independently of the emitted
variables and values.

Usage examples:

    bitbake-env DISTRO MACHINE do_configure
    bitbake-env -r virtual/kernel FILE
    eval $(bitbake-env TMPDIR | grep -v '^#')
-- 
Christopher Larson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/bitbake-devel/attachments/20121122/5940c36d/attachment-0001.html>


More information about the bitbake-devel mailing list