소스 검색

bitbake: data_smart/BBHandler: Fix SkipParse exception handling

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.

(Bitbake rev: 7467d7d66b24cc8f43ab168e65895e7c4aee6092)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Richard Purdie 12 년 전
부모
커밋
853d707af5
2개의 변경된 파일8개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 0
      bitbake/lib/bb/data_smart.py
  2. 6 1
      bitbake/lib/bb/parse/parse_py/BBHandler.py

+ 2 - 0
bitbake/lib/bb/data_smart.py

@@ -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)
 

+ 6 - 1
bitbake/lib/bb/parse/parse_py/BBHandler.py

@@ -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)