To undefine in .bbappend shell function defined in .bb file

1.1k Views Asked by At

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.

1

There are 1 best solutions below

3
Richard Purdie On

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