parse/ast: Expand inherit statements before splitting them

This means that statements that expand to more then one entry
such as:

CLASSES = "a b"
inherit ${CLASSES}

work correctly instead of trying to inherit a class called "a b".

(Bitbake rev: 2568e9ace6e6f483e1bf2a9ef2f4d8318d6c85b7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie 2012-03-03 09:45:58 +00:00
parent b1256965bb
commit d3d9a37aa7
3 changed files with 4 additions and 4 deletions

View File

@ -1433,7 +1433,7 @@ def _parse(fn, data, include=True):
@catch_parse_error
def _inherit(bbclass, data):
bb.parse.BBHandler.inherit([bbclass], "configuration INHERITs", 0, data)
bb.parse.BBHandler.inherit(bbclass, "configuration INHERITs", 0, data)
return data
class ParsingFailure(Exception):

View File

@ -304,7 +304,7 @@ def handleBBHandlers(statements, filename, lineno, m):
def handleInherit(statements, filename, lineno, m):
classes = m.group(1)
statements.append(InheritNode(filename, lineno, classes.split()))
statements.append(InheritNode(filename, lineno, classes))
def finalize(fn, d, variant = None):
all_handlers = {}
@ -452,7 +452,7 @@ def multi_finalize(fn, d):
d.setVar("BBEXTENDVARIANT", variantmap[name])
else:
d.setVar("PN", "%s-%s" % (pn, name))
bb.parse.BBHandler.inherit([extendedmap[name]], fn, 0, d)
bb.parse.BBHandler.inherit(extendedmap[name], fn, 0, d)
safe_d.setVar("BBCLASSEXTEND", extended)
_create_variants(datastores, extendedmap.keys(), extendfunc)

View File

@ -70,8 +70,8 @@ def supports(fn, d):
def inherit(files, fn, lineno, d):
__inherit_cache = data.getVar('__inherit_cache', d) or []
files = d.expand(files).split()
for file in files:
file = data.expand(file, d)
if not os.path.isabs(file) and not file.endswith(".bbclass"):
file = os.path.join('classes', '%s.bbclass' % file)