Commit Graph

11 Commits

Author SHA1 Message Date
Andreas Oberritter 2b9660cad0 recipe_sanity.bbclass: avoid error when running 'bitbake -e'
Running 'bitbake -e' without further arguments causes a stack trace on stderr:

| ERROR: Command execution failed: Traceback (most recent call last):
|   File "[...]/bitbake/lib/bb/command.py", line 99, in runAsyncCommand
|     commandmethod(self.cmds_async, self, options)
|   File "[...]/bitbake/lib/bb/command.py", line 405, in showEnvironment
|     command.cooker.showEnvironment(bfile)
|   File "[...]/bitbake/lib/bb/cooker.py", line 453, in showEnvironment
|     logger.plain("\npython %s () {\n%s}\n", e, data.getVar(e, envdata, 1))
|   File "[...]/bitbake/lib/bb/data.py", line 89, in getVar
|     return d.getVar(var, exp)
|   File "[...]/bitbake/lib/bb/data_smart.py", line 522, in getVar
|     return self.getVarFlag(var, "_content", expand, noweakdefault)
|   File "[...]/bitbake/lib/bb/data_smart.py", line 612, in getVarFlag
|     value = self.expand(value, cachename)
|   File "[...]/bitbake/lib/bb/data_smart.py", line 350, in expand
|     return self.expandWithRefs(s, varname).value
|   File "[...]/bitbake/lib/bb/data_smart.py", line 340, in expandWithRefs
|     raise ExpansionError(varname, s, exc)
| ExpansionError: Failure expanding variable can_delete_FILESPATH, expression was def can_delete_FILESPATH(cfgdata, d):
|     expected = cfgdata.get("FILESPATH")
|     #expected = "${@':'.join([os.path.normpath(os.path.join(fp, p, o)) for fp in d.getVar('FILESPATHBASE', True).split(':') for p in d.getVar('FILESPATHPKG', True).split(':') for o in (d.getVar('OVERRIDES', True) + ':').split(':') if os.path.exists(os.path.join(fp, p, o))])}:${FILESDIR}"
|     expectedpaths = d.expand(expected)
|     unexpanded = d.getVar("FILESPATH", 0)
|     filespath = d.getVar("FILESPATH", True).split(":")
|     filespath = [os.path.normpath(f) for f in filespath if os.path.exists(f)]
|     for fp in filespath:
|         if not fp in expectedpaths:
|             # __note("Path %s in FILESPATH not in the expected paths %s" %
|             # (fp, expectedpaths), d)
|             return False
|     return expected != unexpanded
|  which triggered exception AttributeError: 'NoneType' object has no attribute 'split'

Removing the commented second line in can_delete_FILESPATH() hides the error.

(From OE-Core rev: a84c36e0e5e8332ddc5a6c34e1f598d5cb87cee2)

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-23 11:43:27 +01:00
Richard Purdie 554c892ccf meta: Don't use deprecated bitbake API
These have been deprecated for a long time, convert the remaining
references to the correct modules and prepare for removal of the
compatibility support from bitbake.

(From OE-Core rev: 6a39835af2b2b3c7797fe05479341d71a3f3aaf6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-01 15:51:42 +01:00
Richard Purdie 93ec1e347c classes: Remove references to _remove in function names since this may become a bitbake keyword
There is a good chance we might want to support a bitbake operator
"_remove" which works in a similar way to _append and _prepend. As
such, we can't use those keywords in function or variable names.

(From OE-Core rev: 491fde8cd3fd493f9fec2fd434fe1be547f66148)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-26 11:29:45 +01:00
Richard Purdie 53841ce521 classes/conf: Add eventmasks for event handlers
Now that bitbake supports masking events for event handlers, lets use
this so event handlers are only called for events they care about. This
lets us simplify the code indentation a bit at least as well as mildly
improving the event handling performance.

(From OE-Core rev: bff73743280f9eafebe4591f7368ead91a4eb74d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-14 12:55:47 +01:00
Phil Blundell 2b5acdc0bc recipe_sanity: Don't bother checking LICENSE
Since e3d7890cac or so, base.bbclass has
considered invalid LICENSE settings to be a fatal error.  This means we
will never see them so there is no point checking for that.

(From OE-Core rev: e2d71503847f72f55666143a2a320925838fd26f)

Signed-off-by: Phil Blundell <philb@gnu.org>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-18 12:13:39 +01:00
Richard Purdie 48619958d5 meta/classes: Various python whitespace fixes
It was pointed out we have a number of weird indentations in the python functions.
This patch cleans up 3, 7 and other weird indentations for the core bbclass files.

It also fixes some wierd (odd) shell function indentation which my searches picked up.

(From OE-Core rev: 8385d6d74624000d68814f4e3266d47bc8885942)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-21 12:15:30 +01:00
Richard Purdie 73cf0335c4 Remove a number of unneeded import os/bb calls
The bb and os modules are always imported so having these extra import calls
are a waste of space/execution time. They also set a bad example for people
copy and pasting code so clean them up.

(From OE-Core rev: 7d674820958be3a7051ea619effe1a6061d9cbe2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-19 12:24:50 +01:00
Richard Purdie 5c581b2610 meta/classes: Update recrdeptask fields for recursive dependency handling changes in bitbake
This also deletes the buildall task since I seen usecases for it.

(From OE-Core rev: 8229fb5d7205f5e5b198ab2860fbcc02054476eb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-04 14:48:13 +01:00
Richard Purdie b1aeaa8b0d meta: Replace bb.data.expand(xxx, d) -> d.expand(xxx)
sed \
 -e 's:bb.data.\(expand([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
 -i `grep -ril bb.data.expand *`

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-05 10:23:53 -08:00
Richard Purdie 06f2f8ce0a meta: Convert getVar/getVarFlag(xxx, 1) -> (xxx, True)
Using "1" with getVar is bad coding style and "True" is preferred.
This patch is a sed over the meta directory of the form:

sed \
 -e 's:\(\.getVar([^,()]*, \)1 *):\1True):g' \
 -e 's:\(\.getVarFlag([^,()]*, [^,()]*, \)1 *):\1True):g' \
 -i `grep -ril getVar *`

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-05 10:22:56 -08:00
Phil Blundell e0a18ddffe import recipe_sanity.bbclass from oe master
This is a verbatim copy of the corresponding class from oe master.

(From OE-Core rev: fa32b087888bab399a5cd1e3f16213575fe396e2)

Signed-off-by: Phil Blundell <philb@gnu.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-14 15:28:23 +01:00