]> code.ossystems Code Review - openembedded-core.git/commitdiff
license.bbclass: cleanly handle invalid licenses in incompatible_license
authorChristopher Larson <chris_larson@mentor.com>
Tue, 15 Jan 2013 20:22:48 +0000 (13:22 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 18 Jan 2013 13:04:00 +0000 (13:04 +0000)
This gives us an error message (bb.fatal) rather than a traceback due to the
uncaught LicenseError.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/license.bbclass

index cfb816d5a4429a7165771c37e26ebe1add4ce2db..cd18e198d4c752c7e47eab1d9dfd4dcb22f6b4bd 100644 (file)
@@ -237,7 +237,10 @@ def incompatible_license(d, dont_want_licenses, package=None):
     def choose_lic_set(a, b):
         return a if all(license_ok(lic) for lic in a) else b
 
-    licenses=oe.license.flattened_licenses(license, choose_lic_set)
+    try:
+        licenses = oe.license.flattened_licenses(license, choose_lic_set)
+    except oe.license.LicenseError as exc:
+        bb.fatal('%s: %s' % (d.getVar('P', True), exc))
     return any(not license_ok(l) for l in licenses)
 
 def check_license_flags(d):