diff options
| author | Richard Purdie <rpurdie@linux.intel.com> | 2010-01-20 18:46:02 +0000 |
|---|---|---|
| committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-01-20 18:46:02 +0000 |
| commit | 22c29d8651668195f72e2f6a8e059d625eb511c3 (patch) | |
| tree | dd1dd43f0ec47a9964c8a766eb8b3ad75cf51a64 /bitbake/lib/bb/parse/parse_py | |
| parent | 1bfd6edef9db9c9175058ae801d1b601e4f15263 (diff) | |
| download | poky-22c29d8651668195f72e2f6a8e059d625eb511c3.tar.gz | |
bitbake: Switch to bitbake-dev version (bitbake master upstream)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/parse/parse_py')
| -rw-r--r-- | bitbake/lib/bb/parse/parse_py/BBHandler.py | 32 | ||||
| -rw-r--r-- | bitbake/lib/bb/parse/parse_py/ConfHandler.py | 13 |
2 files changed, 30 insertions, 15 deletions
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): | |||
| 94 | for f in anonfuncs: | 94 | for f in anonfuncs: |
| 95 | code = code + " %s(d)\n" % f | 95 | code = code + " %s(d)\n" % f |
| 96 | data.setVar("__anonfunc", code, d) | 96 | data.setVar("__anonfunc", code, d) |
| 97 | build.exec_func_python("__anonfunc", d) | 97 | build.exec_func("__anonfunc", d) |
| 98 | data.delVar('T', d) | 98 | data.delVar('T', d) |
| 99 | if t: | 99 | if t: |
| 100 | data.setVar('T', t, d) | 100 | data.setVar('T', t, d) |
| @@ -114,7 +114,7 @@ def finalise(fn, d): | |||
| 114 | tasklist = data.getVar('__BBTASKS', d) or [] | 114 | tasklist = data.getVar('__BBTASKS', d) or [] |
| 115 | bb.build.add_tasks(tasklist, d) | 115 | bb.build.add_tasks(tasklist, d) |
| 116 | 116 | ||
| 117 | bb.event.fire(bb.event.RecipeParsed(fn, d)) | 117 | bb.event.fire(bb.event.RecipeParsed(fn), d) |
| 118 | 118 | ||
| 119 | 119 | ||
| 120 | def handle(fn, d, include = 0): | 120 | def handle(fn, d, include = 0): |
| @@ -185,18 +185,26 @@ def handle(fn, d, include = 0): | |||
| 185 | multi = data.getVar('BBCLASSEXTEND', d, 1) | 185 | multi = data.getVar('BBCLASSEXTEND', d, 1) |
| 186 | if multi: | 186 | if multi: |
| 187 | based = bb.data.createCopy(d) | 187 | based = bb.data.createCopy(d) |
| 188 | else: | ||
| 189 | based = d | ||
| 190 | try: | ||
| 188 | finalise(fn, based) | 191 | finalise(fn, based) |
| 189 | darray = {"": based} | 192 | except bb.parse.SkipPackage: |
| 190 | for cls in multi.split(): | 193 | bb.data.setVar("__SKIPPED", True, based) |
| 191 | pn = data.getVar('PN', d, True) | 194 | darray = {"": based} |
| 192 | based = bb.data.createCopy(d) | 195 | |
| 193 | data.setVar('PN', pn + '-' + cls, based) | 196 | for cls in (multi or "").split(): |
| 194 | inherit([cls], based) | 197 | pn = data.getVar('PN', d, True) |
| 198 | based = bb.data.createCopy(d) | ||
| 199 | data.setVar('PN', pn + '-' + cls, based) | ||
| 200 | inherit([cls], based) | ||
| 201 | try: | ||
| 195 | finalise(fn, based) | 202 | finalise(fn, based) |
| 196 | darray[cls] = based | 203 | except bb.parse.SkipPackage: |
| 197 | return darray | 204 | bb.data.setVar("__SKIPPED", True, based) |
| 198 | else: | 205 | darray[cls] = based |
| 199 | finalise(fn, d) | 206 | return darray |
| 207 | |||
| 200 | bbpath.pop(0) | 208 | bbpath.pop(0) |
| 201 | if oldfile: | 209 | if oldfile: |
| 202 | bb.data.setVar("FILE", oldfile, d) | 210 | 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+(.+)" ) | |||
| 34 | __export_regexp__ = re.compile( r"export\s+(.+)" ) | 34 | __export_regexp__ = re.compile( r"export\s+(.+)" ) |
| 35 | 35 | ||
| 36 | def init(data): | 36 | def init(data): |
| 37 | if not bb.data.getVar('TOPDIR', data): | 37 | topdir = bb.data.getVar('TOPDIR', data) |
| 38 | bb.data.setVar('TOPDIR', os.getcwd(), data) | 38 | if not topdir: |
| 39 | topdir = os.getcwd() | ||
| 40 | bb.data.setVar('TOPDIR', topdir, data) | ||
| 39 | if not bb.data.getVar('BBPATH', data): | 41 | if not bb.data.getVar('BBPATH', data): |
| 40 | bb.data.setVar('BBPATH', os.path.join(sys.prefix, 'share', 'bitbake'), data) | 42 | from pkg_resources import Requirement, resource_filename |
| 43 | bitbake = Requirement.parse("bitbake") | ||
| 44 | datadir = resource_filename(bitbake, "../share/bitbake") | ||
| 45 | basedir = resource_filename(bitbake, "..") | ||
| 46 | bb.data.setVar('BBPATH', '%s:%s:%s' % (topdir, datadir, basedir), data) | ||
| 47 | |||
| 41 | 48 | ||
| 42 | def supports(fn, d): | 49 | def supports(fn, d): |
| 43 | return localpath(fn, d)[-5:] == ".conf" | 50 | return localpath(fn, d)[-5:] == ".conf" |
