Skip to contentSkip to conversation

calling python functions or mixing shell and python code

DISCUSSION Holger Freyther 1 participant 1 message Sep 21, 2007 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

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_more before do_unpack after do_fetch

But 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.