diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-05-30 15:55:37 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-06-01 14:29:31 +0100 |
commit | 91a164cb872d0c1f20d3a11c637c3a15fb1c8f77 (patch) | |
tree | 98ca4b91d3d6eeb4f0ec3e9244c64f2404bd3beb /bitbake/lib | |
parent | 044296ce4c40edb9b5584a5f4118882944b248f6 (diff) | |
download | poky-91a164cb872d0c1f20d3a11c637c3a15fb1c8f77.tar.gz |
bitbake: event: Add SkipRecipe event to replace SkipPackage
In the depths of time we were rather confused about naming. bb files
are recipes, the event to skip parsing them should be SkipRecipe,
not SkipPackage. This changes bitbake to use the better name but
leaves the other around for now. We can therefore start removing
references to it from the metadata.
(Bitbake rev: 98d9e6e0f514a7cb7da1d99bf4bd5602b89426d6)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/build.py | 2 | ||||
-rw-r--r-- | bitbake/lib/bb/cache.py | 2 | ||||
-rw-r--r-- | bitbake/lib/bb/data_smart.py | 2 | ||||
-rw-r--r-- | bitbake/lib/bb/event.py | 2 | ||||
-rw-r--r-- | bitbake/lib/bb/parse/__init__.py | 7 | ||||
-rw-r--r-- | bitbake/lib/bb/parse/ast.py | 6 | ||||
-rw-r--r-- | bitbake/lib/bb/parse/parse_py/BBHandler.py | 2 | ||||
-rw-r--r-- | bitbake/lib/bb/utils.py | 2 |
8 files changed, 14 insertions, 11 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py index 5cb4c06a88..98ee36ce58 100644 --- a/bitbake/lib/bb/build.py +++ b/bitbake/lib/bb/build.py | |||
@@ -243,7 +243,7 @@ def exec_func_python(func, d, runfile, cwd=None): | |||
243 | comp = utils.better_compile(code, func, bbfile) | 243 | comp = utils.better_compile(code, func, bbfile) |
244 | utils.better_exec(comp, {"d": d}, code, bbfile) | 244 | utils.better_exec(comp, {"d": d}, code, bbfile) |
245 | except: | 245 | except: |
246 | if sys.exc_info()[0] in (bb.parse.SkipPackage, bb.build.FuncFailed): | 246 | if sys.exc_info()[0] in (bb.parse.SkipRecipe, bb.build.FuncFailed): |
247 | raise | 247 | raise |
248 | 248 | ||
249 | raise FuncFailed(func, None) | 249 | raise FuncFailed(func, None) |
diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py index 431fc079e4..38e91480bf 100644 --- a/bitbake/lib/bb/cache.py +++ b/bitbake/lib/bb/cache.py | |||
@@ -692,7 +692,7 @@ def init(cooker): | |||
692 | 692 | ||
693 | * Its mtime | 693 | * Its mtime |
694 | * The mtimes of all its dependencies | 694 | * The mtimes of all its dependencies |
695 | * Whether it caused a parse.SkipPackage exception | 695 | * Whether it caused a parse.SkipRecipe exception |
696 | 696 | ||
697 | Files causing parsing errors are evicted from the cache. | 697 | Files causing parsing errors are evicted from the cache. |
698 | 698 | ||
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py index 707029de93..3d773b1d69 100644 --- a/bitbake/lib/bb/data_smart.py +++ b/bitbake/lib/bb/data_smart.py | |||
@@ -334,7 +334,7 @@ class DataSmart(MutableMapping): | |||
334 | break | 334 | break |
335 | except ExpansionError: | 335 | except ExpansionError: |
336 | raise | 336 | raise |
337 | except bb.parse.SkipPackage: | 337 | except bb.parse.SkipRecipe: |
338 | raise | 338 | raise |
339 | except Exception as exc: | 339 | except Exception as exc: |
340 | raise ExpansionError(varname, s, exc) | 340 | raise ExpansionError(varname, s, exc) |
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py index 05ff5434ac..8b47ae5957 100644 --- a/bitbake/lib/bb/event.py +++ b/bitbake/lib/bb/event.py | |||
@@ -72,7 +72,7 @@ def execute_handler(name, handler, event, d): | |||
72 | event.data = d | 72 | event.data = d |
73 | try: | 73 | try: |
74 | ret = handler(event) | 74 | ret = handler(event) |
75 | except (bb.parse.SkipPackage, bb.BBHandledException): | 75 | except (bb.parse.SkipRecipe, bb.BBHandledException): |
76 | raise | 76 | raise |
77 | except Exception: | 77 | except Exception: |
78 | etype, value, tb = sys.exc_info() | 78 | etype, value, tb = sys.exc_info() |
diff --git a/bitbake/lib/bb/parse/__init__.py b/bitbake/lib/bb/parse/__init__.py index bf5ed05e7f..2303f15b9e 100644 --- a/bitbake/lib/bb/parse/__init__.py +++ b/bitbake/lib/bb/parse/__init__.py | |||
@@ -49,8 +49,11 @@ class ParseError(Exception): | |||
49 | else: | 49 | else: |
50 | return "ParseError in %s: %s" % (self.filename, self.msg) | 50 | return "ParseError in %s: %s" % (self.filename, self.msg) |
51 | 51 | ||
52 | class SkipPackage(Exception): | 52 | class SkipRecipe(Exception): |
53 | """Exception raised to skip this package""" | 53 | """Exception raised to skip this recipe""" |
54 | |||
55 | class SkipPackage(SkipRecipe): | ||
56 | """Exception raised to skip this recipe (use SkipRecipe in new code)""" | ||
54 | 57 | ||
55 | __mtime_cache = {} | 58 | __mtime_cache = {} |
56 | def cached_mtime(f): | 59 | def cached_mtime(f): |
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py index 30380a4bf6..4e5a06e761 100644 --- a/bitbake/lib/bb/parse/ast.py +++ b/bitbake/lib/bb/parse/ast.py | |||
@@ -386,7 +386,7 @@ def multi_finalize(fn, d): | |||
386 | d = bb.data.createCopy(safe_d) | 386 | d = bb.data.createCopy(safe_d) |
387 | try: | 387 | try: |
388 | finalize(fn, d) | 388 | finalize(fn, d) |
389 | except bb.parse.SkipPackage as e: | 389 | except bb.parse.SkipRecipe as e: |
390 | d.setVar("__SKIPPED", e.args[0]) | 390 | d.setVar("__SKIPPED", e.args[0]) |
391 | datastores = {"": safe_d} | 391 | datastores = {"": safe_d} |
392 | 392 | ||
@@ -429,7 +429,7 @@ def multi_finalize(fn, d): | |||
429 | verfunc(pv, d, safe_d) | 429 | verfunc(pv, d, safe_d) |
430 | try: | 430 | try: |
431 | finalize(fn, d) | 431 | finalize(fn, d) |
432 | except bb.parse.SkipPackage as e: | 432 | except bb.parse.SkipRecipe as e: |
433 | d.setVar("__SKIPPED", e.args[0]) | 433 | d.setVar("__SKIPPED", e.args[0]) |
434 | 434 | ||
435 | _create_variants(datastores, versions, verfunc, onlyfinalise) | 435 | _create_variants(datastores, versions, verfunc, onlyfinalise) |
@@ -469,7 +469,7 @@ def multi_finalize(fn, d): | |||
469 | try: | 469 | try: |
470 | if not onlyfinalise or variant in onlyfinalise: | 470 | if not onlyfinalise or variant in onlyfinalise: |
471 | finalize(fn, variant_d, variant) | 471 | finalize(fn, variant_d, variant) |
472 | except bb.parse.SkipPackage as e: | 472 | except bb.parse.SkipRecipe as e: |
473 | variant_d.setVar("__SKIPPED", e.args[0]) | 473 | variant_d.setVar("__SKIPPED", e.args[0]) |
474 | 474 | ||
475 | if len(datastores) > 1: | 475 | if len(datastores) > 1: |
diff --git a/bitbake/lib/bb/parse/parse_py/BBHandler.py b/bitbake/lib/bb/parse/parse_py/BBHandler.py index a8627e9c07..9633340d1b 100644 --- a/bitbake/lib/bb/parse/parse_py/BBHandler.py +++ b/bitbake/lib/bb/parse/parse_py/BBHandler.py | |||
@@ -154,7 +154,7 @@ def handle(fn, d, include): | |||
154 | 154 | ||
155 | try: | 155 | try: |
156 | statements.eval(d) | 156 | statements.eval(d) |
157 | except bb.parse.SkipPackage: | 157 | except bb.parse.SkipRecipe: |
158 | bb.data.setVar("__SKIPPED", True, d) | 158 | bb.data.setVar("__SKIPPED", True, d) |
159 | if include == 0: | 159 | if include == 0: |
160 | return { "" : d } | 160 | return { "" : d } |
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index ead5f366b0..c179394dc9 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py | |||
@@ -362,7 +362,7 @@ def better_exec(code, context, text = None, realfile = "<code>"): | |||
362 | except Exception as e: | 362 | except Exception as e: |
363 | (t, value, tb) = sys.exc_info() | 363 | (t, value, tb) = sys.exc_info() |
364 | 364 | ||
365 | if t in [bb.parse.SkipPackage, bb.build.FuncFailed]: | 365 | if t in [bb.parse.SkipRecipe, bb.build.FuncFailed]: |
366 | raise | 366 | raise |
367 | try: | 367 | try: |
368 | _print_exception(t, value, tb, realfile, text, context) | 368 | _print_exception(t, value, tb, realfile, text, context) |