All of lore.kernel.org
 help / color / mirror / Atom feed
* Calling python function from shell function
@ 2015-11-07 17:27 Vuille, Martin (Martin)
  2015-11-07 18:04 ` Christopher Larson
  0 siblings, 1 reply; 2+ messages in thread
From: Vuille, Martin (Martin) @ 2015-11-07 17:27 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 365 bytes --]

In my custom .bbclass, I have a python function

python whatever () {
    ...
}

and I would like to call it from a shell function

do_something () {
    ...
    whatever
    ...
}

but bitbake gives me an error "whatever: not found" when building
recipes based on this class

Is what I am trying to do possible? Do I have the syntax wrong?

MV

[-- Attachment #2: Type: text/html, Size: 3374 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Calling python function from shell function
  2015-11-07 17:27 Calling python function from shell function Vuille, Martin (Martin)
@ 2015-11-07 18:04 ` Christopher Larson
  0 siblings, 0 replies; 2+ messages in thread
From: Christopher Larson @ 2015-11-07 18:04 UTC (permalink / raw)
  To: Vuille, Martin (Martin); +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 1019 bytes --]

On Sat, Nov 7, 2015 at 10:27 AM, Vuille, Martin (Martin) <vmartin@avaya.com>
wrote:

> In my custom .bbclass, I have a python function
>
>
>
> python whatever () {
>
>     …
>
> }
>
>
>
> and I would like to call it from a shell function
>
>
>
> do_something () {
>
>     …
>
>     whatever
>
>     …
>
> }
>
>
>
> but bitbake gives me an error “whatever: not found” when building
>
> recipes based on this class
>
>
>
> Is what I am trying to do possible? Do I have the syntax wrong?
>

Not doable, no. You could make a python do_something which calls both
`whatever` and your shell `something_shell`, though. i.e.

python whatever () {
    pass
}

do_something_shell () {
    :
}

python do_something () {
    bb.build.exec_func("whatever", d)
    bb.build.exec_func("something_shell", d)
}
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics

[-- Attachment #2: Type: text/html, Size: 2889 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-11-07 18:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-07 17:27 Calling python function from shell function Vuille, Martin (Martin)
2015-11-07 18:04 ` Christopher Larson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.