[OE-core] How to reuse code in oe-core environment

Chris Larson clarson at kergoth.com
Wed Jun 29 23:59:33 UTC 2011


On Wed, Jun 29, 2011 at 4:02 PM, Andreas Mueller <schnitzeltony at gmx.de> wrote:
> foo() {
>        # code to reuse
> }
>
> and called foo from several recipes. In oe-core the run.* scripts are much more
> stripped of unnecessary.  All the code included by 'require' seems to miss, so
> the function foo() will not be found.
>
> My searches for examples did not lead to a hook so what is the suggested
> solution for reusing code for multiple recipes in oe-core?

The require doesn't have to do with anything. bitbake emits only the
functions which get called somewhere from the task being run. It
tracks what variables reference what other variables. If you call a
shell function from another shell function, it tracks this, and
realizes that both need to be emitted. Either you're doing something
wrong, or you're doing something in a way that bitbake can't track.
There's a variable flag you can set to explicitly add variable
dependencies.
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics




More information about the Openembedded-core mailing list