Commit Graph

15 Commits

Author SHA1 Message Date
Richard Purdie a584c181ac recipe_sanity: Drop now unused FILESDIR
FILESDIR is long dead and unreferenced pretty much anywhere now, drop these
sanity references too.

(From OE-Core rev: 760ab75be6b794fdcd0b1717439fcea605db9e0b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-05 23:22:11 +01:00
Joshua Lock c4e2c59088 meta: remove True option to getVar calls
getVar() now defaults to expanding by default, thus remove the True
option from getVar() calls with a regex search and replace.

Search made with the following regex: getVar ?\(( ?[^,()]*), True\)

(From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16 10:23:23 +00:00
Robert Yang 02e6c1e520 meta: cleanup d.getVar(var, 0)
(From OE-Core rev: 33b0d940b09a5ce1462476614213a58d3d62e80d)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-14 22:22:07 +01:00
Robert Yang bee556aa0d recipe_sanity.bbclass: skip DataSmart in recipe_sanity_eh()
Fixed:
$ bitbake quilt -crecipe_sanity
  File "/path/to/poky/bitbake/lib/bb/siggen.py", line 261, in dump_sigtask
    p = pickle.dump(data, stream, -1)
PicklingError: Can't pickle <COWDict Level: 1 Current Keys: 0>:
attribute lookup bb.COW.C failed

This is because of:
cfgdata[k] = d.getVar(k, 0)

If d.getVar(k, 0) is a DataSmart (for example, BB_ORIGENV), it won't
have the attribute of bb.COW.C, so the error happend.

(From OE-Core rev: 9979f8ad588564cd9d177e24a28ceefefec4df7d)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-21 09:32:41 +00:00
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