[oe] calling python functions or mixing shell and python code
Holger Freyther
zecke at selfish.org
Fri Sep 21 12:19:04 UTC 2007
Am 17.09.2007 um 20:55 schrieb Detlef Vollmann:
> Hello,
>
> how can I mix shell and python code in the same task?
>
> To be more concrete, here is what I tried:
> python do_fetch_more () {
> import bb
>
> bb.data.setVar('SRC_URI', '${SRC_URI_BASEPACKS}', d)
> base_do_fetch
> }
> addtask fetch_more before do_unpack after do_fetch
>
> But this doesn't work.
>
> Another approach was:
> do_fetch_base () {
> export SRC_URI=${SRC_URI_BASEPACKS}
> base_do_fetch
> }
>
> But of course this also doesn't work...
>
> Any help appreciated,
Hi,
as no one else answered I will try to do that. The common practice is
to add an intermediate python function that is calling the two other
functions.
Using bb.build.exec_func and bb.build.exec_task you can call the
functions/tasks you want.
I hope this helps.
z.
More information about the Openembedded-devel
mailing list