17

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?

Tom Zych
  • 12,329
  • 9
  • 33
  • 51
ELO
  • 269
  • 1
  • 3
  • 4
  • I believe do is some sort of object that represents the environment of the bitbake recipe. It appears you can get and set variables (which would be the shell-looking variables in the .bb files). Aside from reading through the code I have no idea but would be interested to know. – user318904 Jul 16 '14 at 16:05

2 Answers2

12

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.
    """
Fl0v0
  • 791
  • 9
  • 24
3

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

Brad
  • 2,430
  • 16
  • 33