]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
data_smart/BBHandler: Fix SkipParse exception handling
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 14 Dec 2012 12:33:01 +0000 (12:33 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 14 Dec 2012 12:35:51 +0000 (12:35 +0000)
If SkipParse is raised from something which isn't anonymous python, it wasn't
being handled correctly. This improves the handling for example from within inline
python.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/data_smart.py
lib/bb/parse/parse_py/BBHandler.py

index fb8d9d53c00256d6c022cd369aab1350813a7446..d3284009035dde3bed97d7138e4bf39266288f57 100644 (file)
@@ -143,6 +143,8 @@ class DataSmart(MutableMapping):
                     break
             except ExpansionError:
                 raise
+            except bb.parse.SkipPackage:
+                raise
             except Exception as exc:
                 raise ExpansionError(varname, s, exc)
 
index e6039e11a2048d1a3a90df2f90e8e96cdd43f1ae..2ee8ebd28f52a2eee9b185052b8ea4151f8e5a7d 100644 (file)
@@ -153,7 +153,12 @@ def handle(fn, d, include):
     if ext != ".bbclass":
         data.setVar('FILE', abs_fn, d)
 
-    statements.eval(d)
+    try:
+        statements.eval(d)
+    except bb.parse.SkipPackage:
+        bb.data.setVar("__SKIPPED", True, d)
+        if include == 0:
+            return { "" : d }
 
     if ext != ".bbclass" and include == 0:
         return ast.multi_finalize(fn, d)