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

Christopher Larson kergoth at gmail.com
Wed Apr 18 23:06:49 UTC 2012


${@} contents are evaluated when the variable is expanded. Variables are expanded when they're used, much in the way they are in makefiles. Use := to force immediate expansion, or don't use ${@} (alternatives, anonymous python function or event handler).

-- 
Christopher Larson


On Wednesday, April 18, 2012 at 2:21 PM, Daniel Lazzari wrote:

> Hi everyone,
> 
> I've been wrestling with this problem for over a day now so I figured it's time to call in the cavalry.
> I have a class in our layer that needs to fill in a variable (EXTERNPV) with information about svn externals in a project. This process can be very time consuming and resource intensive so I would prefer that it only happen once per run. Unfortunately, it seems to run 5 times for each recipe that inherits the class. You can easily duplicate the behavior I see with the following:
> 
> def testFunc(bb, d):
> print( bb.data.getVar("PN", d, True) )
> return "e1"
> 
> EXTERNPV = "${@testFunc(bb, d)}"
> 
> Am I doing something wrong? Is there some assignment operator I can use to ensure this only has to be done once? Or maybe a variable flag?
> 
> As always, I very much appreciate the help.
> 
> Dan Lazzari Jr.
> Firmware Engineer
> dlazzari at leapfrog.com (mailto:dlazzari at leapfrog.com)
> 
> 
> _______________________________________________
> bitbake-devel mailing list
> bitbake-devel at lists.openembedded.org (mailto:bitbake-devel at lists.openembedded.org)
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/bitbake-devel
> 
> 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/bitbake-devel/attachments/20120418/e8f24267/attachment-0001.html>


More information about the bitbake-devel mailing list