Patchwork [CONSOLIDATED,PULL,05/12] sanity.bbclass: Check for bogus values in BBCLASSEXTEND

login
register
mail settings
Submitter Saul Wold
Date May 9, 2012, 5:29 a.m.
Message ID <e0a2e7b8debfecf2e178cec796cae7b3c74897d4.1336516205.git.sgw@linux.intel.com>
Download mbox | patch
Permalink /patch/27347/
State New
Headers show

Comments

Saul Wold - May 9, 2012, 5:29 a.m.
From: Peter Seebach <peter.seebach@windriver.com>

Suggestion that came out of my sanity-checks of multilibs; verify
that stuff in BBCLASSEXTEND is valid.

Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
---
 meta/classes/sanity.bbclass |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

Patch

diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index 635049e..9f3f1d5 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -81,6 +81,15 @@  def check_toolchain(data):
 
     return ""
 
+def check_bbclassextend(data):
+    allowed = ('native', 'nativesdk', 'multilib', 'cross')
+    extends = (data.getVar("BBCLASSEXTEND", True) or "").split()
+    errors = []
+    for pair in [x.split(':') for x in extends]:
+        if pair[0] not in allowed:
+            errors.append('BBCLASSEXTEND has invalid value: %s' % pair[0])
+    return '\n'.join(errors)
+
 def check_conf_exists(fn, data):
     bbpath = []
     fn = data.expand(fn)
@@ -401,6 +410,10 @@  def check_sanity(e):
     if toolchain_msg != "":
         messages = messages + toolchain_msg + '\n'
 
+    bbclassextend_msg = check_bbclassextend(e.data)
+    if bbclassextend_msg != "":
+        messages = messages + bbclassextend_msg + '\n'
+
     # Check if DISPLAY is set if IMAGETEST is set
     if not data.getVar( 'DISPLAY', e.data, True ) and data.getVar( 'IMAGETEST', e.data, True ) == 'qemu':
         messages = messages + 'qemuimagetest needs a X desktop to start qemu, please set DISPLAY correctly (e.g. DISPLAY=:1.0)\n'