calling python functions or mixing shell and python code
Am 17.09.2007 um 20:55 schrieb Detlef Vollmann:
Quoted 16 lines
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_morebeforedo_unpackafterdo_fetchBut this doesn't work.
Another approach was:
Quoted 8 lines
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.