diff options
Diffstat (limited to 'bitbake/lib/bb/parse/parse_py')
| -rw-r--r-- | bitbake/lib/bb/parse/parse_py/BBHandler.py | 51 |
1 files changed, 19 insertions, 32 deletions
diff --git a/bitbake/lib/bb/parse/parse_py/BBHandler.py b/bitbake/lib/bb/parse/parse_py/BBHandler.py index 2a30e5895a..d7bf6d4f37 100644 --- a/bitbake/lib/bb/parse/parse_py/BBHandler.py +++ b/bitbake/lib/bb/parse/parse_py/BBHandler.py | |||
| @@ -95,6 +95,10 @@ def handle(fn, d, include = 0): | |||
| 95 | if ext == ".bbclass": | 95 | if ext == ".bbclass": |
| 96 | __classname__ = root | 96 | __classname__ = root |
| 97 | classes.append(__classname__) | 97 | classes.append(__classname__) |
| 98 | __inherit_cache = data.getVar('__inherit_cache', d) or [] | ||
| 99 | if not fn in __inherit_cache: | ||
| 100 | __inherit_cache.append(fn) | ||
| 101 | data.setVar('__inherit_cache', __inherit_cache, d) | ||
| 98 | 102 | ||
| 99 | if include != 0: | 103 | if include != 0: |
| 100 | oldfile = data.getVar('FILE', d) | 104 | oldfile = data.getVar('FILE', d) |
| @@ -126,10 +130,6 @@ def handle(fn, d, include = 0): | |||
| 126 | 130 | ||
| 127 | if ext != ".bbclass": | 131 | if ext != ".bbclass": |
| 128 | data.setVar('FILE', fn, d) | 132 | data.setVar('FILE', fn, d) |
| 129 | i = (data.getVar("INHERIT", d, 1) or "").split() | ||
| 130 | if not "base" in i and __classname__ != "base": | ||
| 131 | i[0:0] = ["base"] | ||
| 132 | inherit(i, d) | ||
| 133 | 133 | ||
| 134 | lineno = 0 | 134 | lineno = 0 |
| 135 | while 1: | 135 | while 1: |
| @@ -171,33 +171,12 @@ def handle(fn, d, include = 0): | |||
| 171 | all_handlers = {} | 171 | all_handlers = {} |
| 172 | for var in data.getVar('__BBHANDLERS', d) or []: | 172 | for var in data.getVar('__BBHANDLERS', d) or []: |
| 173 | # try to add the handler | 173 | # try to add the handler |
| 174 | # if we added it remember the choiche | ||
| 175 | handler = data.getVar(var,d) | 174 | handler = data.getVar(var,d) |
| 176 | if bb.event.register(var,handler) == bb.event.Registered: | 175 | bb.event.register(var, handler) |
| 177 | all_handlers[var] = handler | ||
| 178 | |||
| 179 | tasklist = {} | ||
| 180 | for var in data.getVar('__BBTASKS', d) or []: | ||
| 181 | if var not in tasklist: | ||
| 182 | tasklist[var] = [] | ||
| 183 | deps = data.getVarFlag(var, 'deps', d) or [] | ||
| 184 | for p in deps: | ||
| 185 | if p not in tasklist[var]: | ||
| 186 | tasklist[var].append(p) | ||
| 187 | |||
| 188 | postdeps = data.getVarFlag(var, 'postdeps', d) or [] | ||
| 189 | for p in postdeps: | ||
| 190 | if p not in tasklist: | ||
| 191 | tasklist[p] = [] | ||
| 192 | if var not in tasklist[p]: | ||
| 193 | tasklist[p].append(var) | ||
| 194 | 176 | ||
| 177 | tasklist = data.getVar('__BBTASKS', d) or [] | ||
| 195 | bb.build.add_tasks(tasklist, d) | 178 | bb.build.add_tasks(tasklist, d) |
| 196 | 179 | ||
| 197 | # now add the handlers | ||
| 198 | if not len(all_handlers) == 0: | ||
| 199 | data.setVar('__all_handlers__', all_handlers, d) | ||
| 200 | |||
| 201 | bbpath.pop(0) | 180 | bbpath.pop(0) |
| 202 | if oldfile: | 181 | if oldfile: |
| 203 | bb.data.setVar("FILE", oldfile, d) | 182 | bb.data.setVar("FILE", oldfile, d) |
| @@ -342,15 +321,23 @@ def feeder(lineno, s, fn, root, d): | |||
| 342 | data.setVarFlag(var, "task", 1, d) | 321 | data.setVarFlag(var, "task", 1, d) |
| 343 | 322 | ||
| 344 | bbtasks = data.getVar('__BBTASKS', d) or [] | 323 | bbtasks = data.getVar('__BBTASKS', d) or [] |
| 345 | bbtasks.append(var) | 324 | if not var in bbtasks: |
| 325 | bbtasks.append(var) | ||
| 346 | data.setVar('__BBTASKS', bbtasks, d) | 326 | data.setVar('__BBTASKS', bbtasks, d) |
| 347 | 327 | ||
| 328 | existing = data.getVarFlag(var, "deps", d) or [] | ||
| 348 | if after is not None: | 329 | if after is not None: |
| 349 | # set up deps for function | 330 | # set up deps for function |
| 350 | data.setVarFlag(var, "deps", after.split(), d) | 331 | for entry in after.split(): |
| 332 | if entry not in existing: | ||
| 333 | existing.append(entry) | ||
| 334 | data.setVarFlag(var, "deps", existing, d) | ||
| 351 | if before is not None: | 335 | if before is not None: |
| 352 | # set up things that depend on this func | 336 | # set up things that depend on this func |
| 353 | data.setVarFlag(var, "postdeps", before.split(), d) | 337 | for entry in before.split(): |
| 338 | existing = data.getVarFlag(entry, "deps", d) or [] | ||
| 339 | if var not in existing: | ||
| 340 | data.setVarFlag(entry, "deps", [var] + existing, d) | ||
| 354 | return | 341 | return |
| 355 | 342 | ||
| 356 | m = __addhandler_regexp__.match(s) | 343 | m = __addhandler_regexp__.match(s) |
