0

One .inc file included in some image-.bb file defines shell function for Bitbake task.

Let's concentrate here merely on this shell function, asigned Bitbake task is out of scope.

I wonder how to undefine this shell function in .bbappend file (other layer).

unset -f <shell-function-name>

is not working

ERROR: ParseError at .......-image.bbappend:89: unparsed line: 'unset -f do_thisandthat'

Does it need be said Bitbake explicitely "unset -f < shell-function-name>" is a shell script?

Me consulted for this question Bitbake Manual and Yocto Project Reference Manual with outcome of zero findings.

  • do you know what you want to do? post your .bbappend file – yoctotutor.com Mar 09 '18 at 12:47
  • Do you mean it's mission impossible? Bitbake-task removal and removal of underlying shell function was made in past and still works. Unfortunately it was made in supplier's layer (recipes over there) by commenting out few lines in those recipes. The plan is to outsource that removal to OEMs own layer. –  Mar 09 '18 at 13:02

1 Answers1

0

There is no direct API for it however you can do something like:

python () {
    d.delVar("shell function name")
}

which will delete the shell function since functions are simply variables.

Just deleting a function may well cause other problems but that does answer your specific question.

This is an 'anonymous python' fragment and will be executed by bitbake at the end of parsing a recipe (or bbappend to a recipe).

Richard Purdie
  • 2,028
  • 10
  • 16
  • Thank you very much for input, will try it out as next. I guess it is Bitbake and its runtime concept which will ensure original function creation then my removal will take place in desired order. Am i right? –  Mar 12 '18 at 10:41
  • Well, for this maybe me needs also to examine few places: e.g. BBFILES. –  Mar 12 '18 at 14:33
  • In other words: Solution provided kindly by Richard - is this the python's function definition and the point where/when it gets called by Bitbake? Quote: "BitBake Style Python Functions: Functions written in Python and executed by BitBake or other Python functions using bb.build.exec_func().", source: Bitbake Manual. –  Mar 12 '18 at 16:39