Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where are bitbake python functions documented

Tags:

yocto

bitbake

I'm trying to find documentation for "bb.utils.contains". I found the code in pokey/bitbake/lib/utils.py, but that code is poorly documented. For instance, it takes a parameter named "d". What is "d"? How do you even get started with a short non-descriptive name like that?

I've downloaded and searched all the yocto and poky documents, and performed a number of web searches, to no avail.

Does anybody know of a good reference to the built in bitbake python utilities?

like image 907
ELO Avatar asked Jul 15 '14 23:07

ELO


People also ask

What is a BitBake file?

BitBake is a make-like build tool with the special focus of distributions and packages for embedded Linux cross compilation, although it is not limited to that. It is inspired by Portage, which is the package management system used by the Gentoo Linux distribution.

What is BB utils contains?

bb. utils. contains is most commonly used function in Yocto. grep in poky directory returned with 696 count.


2 Answers

The best documentation i could find were the docstrings in the code itself. See here: https://github.com/openembedded/bitbake/blob/master/lib/bb/utils.py#L974

def contains(variable, checkvalues, truevalue, falsevalue, d):
    """Check if a variable contains all the values specified.
      Arguments:
        variable -- the variable name. This will be fetched and expanded (using
          d.getVar(variable, True)) and then split into a set().
        checkvalues -- if this is a string it is split on whitespace into a set(),
          otherwise coerced directly into a set().
        truevalue -- the value to return if checkvalues is a subset of variable.
        falsevalue -- the value to return if variable is empty or if checkvalues is
          not a subset of variable.
        d -- the data store.
    """
like image 130
Fl0v0 Avatar answered Oct 03 '22 13:10

Fl0v0


'd' is the current dictionary of all the values being extracted from the environment and recipes. See data.py and data_smart.py.

I agree the bitbake docs are not always complete, but there is a bitbake-dev mailing list that can help as well.

like image 21
Brad Avatar answered Oct 03 '22 12:10

Brad