From 22c29d8651668195f72e2f6a8e059d625eb511c3 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 20 Jan 2010 18:46:02 +0000 Subject: bitbake: Switch to bitbake-dev version (bitbake master upstream) Signed-off-by: Richard Purdie --- bitbake/lib/bb/parse/parse_py/BBHandler.py | 32 +++++++++++++++++----------- bitbake/lib/bb/parse/parse_py/ConfHandler.py | 13 ++++++++--- 2 files changed, 30 insertions(+), 15 deletions(-) (limited to 'bitbake/lib/bb/parse') diff --git a/bitbake/lib/bb/parse/parse_py/BBHandler.py b/bitbake/lib/bb/parse/parse_py/BBHandler.py index 915db214f5..86fa18ebd2 100644 --- a/bitbake/lib/bb/parse/parse_py/BBHandler.py +++ b/bitbake/lib/bb/parse/parse_py/BBHandler.py @@ -94,7 +94,7 @@ def finalise(fn, d): for f in anonfuncs: code = code + " %s(d)\n" % f data.setVar("__anonfunc", code, d) - build.exec_func_python("__anonfunc", d) + build.exec_func("__anonfunc", d) data.delVar('T', d) if t: data.setVar('T', t, d) @@ -114,7 +114,7 @@ def finalise(fn, d): tasklist = data.getVar('__BBTASKS', d) or [] bb.build.add_tasks(tasklist, d) - bb.event.fire(bb.event.RecipeParsed(fn, d)) + bb.event.fire(bb.event.RecipeParsed(fn), d) def handle(fn, d, include = 0): @@ -185,18 +185,26 @@ def handle(fn, d, include = 0): multi = data.getVar('BBCLASSEXTEND', d, 1) if multi: based = bb.data.createCopy(d) + else: + based = d + try: finalise(fn, based) - darray = {"": based} - for cls in multi.split(): - pn = data.getVar('PN', d, True) - based = bb.data.createCopy(d) - data.setVar('PN', pn + '-' + cls, based) - inherit([cls], based) + except bb.parse.SkipPackage: + bb.data.setVar("__SKIPPED", True, based) + darray = {"": based} + + for cls in (multi or "").split(): + pn = data.getVar('PN', d, True) + based = bb.data.createCopy(d) + data.setVar('PN', pn + '-' + cls, based) + inherit([cls], based) + try: finalise(fn, based) - darray[cls] = based - return darray - else: - finalise(fn, d) + except bb.parse.SkipPackage: + bb.data.setVar("__SKIPPED", True, based) + darray[cls] = based + return darray + bbpath.pop(0) if oldfile: bb.data.setVar("FILE", oldfile, d) diff --git a/bitbake/lib/bb/parse/parse_py/ConfHandler.py b/bitbake/lib/bb/parse/parse_py/ConfHandler.py index c9f1ea13fb..23316ada58 100644 --- a/bitbake/lib/bb/parse/parse_py/ConfHandler.py +++ b/bitbake/lib/bb/parse/parse_py/ConfHandler.py @@ -34,10 +34,17 @@ __require_regexp__ = re.compile( r"require\s+(.+)" ) __export_regexp__ = re.compile( r"export\s+(.+)" ) def init(data): - if not bb.data.getVar('TOPDIR', data): - bb.data.setVar('TOPDIR', os.getcwd(), data) + topdir = bb.data.getVar('TOPDIR', data) + if not topdir: + topdir = os.getcwd() + bb.data.setVar('TOPDIR', topdir, data) if not bb.data.getVar('BBPATH', data): - bb.data.setVar('BBPATH', os.path.join(sys.prefix, 'share', 'bitbake'), data) + from pkg_resources import Requirement, resource_filename + bitbake = Requirement.parse("bitbake") + datadir = resource_filename(bitbake, "../share/bitbake") + basedir = resource_filename(bitbake, "..") + bb.data.setVar('BBPATH', '%s:%s:%s' % (topdir, datadir, basedir), data) + def supports(fn, d): return localpath(fn, d)[-5:] == ".conf" -- cgit v1.2.3