[bitbake-devel] python function used in variable expansion called multiple times per recipe

Chris Larson kergoth at gmail.com
Wed Apr 18 23:41:44 UTC 2012


On Wed, Apr 18, 2012 at 4:39 PM, Daniel Lazzari <dlazzari at leapfrog.com> wrote:
> I think immediate expansion is what I’ll need to use, thanks for the tip.
> That at least brings the invocation down to once per run. Unfortunately, the
> variable doesn’t seem to get filled in when I change to immediate expansion.
>
> def testFunc(bb, d):
>                 print( bb.data.getVar("PN", d, True) )
>                 return "e1"
>
> EXTERNPV := "${@testFunc(bb, d)}"
>
> Now only prints the package name once, but using –e, I don’t see the
> variable EXTERNPV at all.

Don't know what to tell you. It does work, so it's something wrong on
your end. Either it's returning an empty string, which will result in
-e only showing the commented out definition, or it's raising an
exception, or something else in your setup. Aside: you don't need to
pass 'bb' in. That namespace is always accessible, even from def'd
python functions.
-- 
Christopher Larson




More information about the bitbake-devel mailing list