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

Daniel Lazzari dlazzari at leapfrog.com
Wed Apr 18 21:21:54 UTC 2012


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





More information about the bitbake-devel mailing list