[oe-commits] Christopher Larson : license.bbclass: cleanly handle invalid licenses in incompatible_license

git at git.openembedded.org git at git.openembedded.org
Sun Jan 20 13:17:57 UTC 2013


Module: openembedded-core.git
Branch: master-next
Commit: 7fab4cd27a2ad896218123ca82252e2b59526726
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=7fab4cd27a2ad896218123ca82252e2b59526726

Author: Christopher Larson <chris_larson at mentor.com>
Date:   Tue Jan 15 13:22:48 2013 -0700

license.bbclass: cleanly handle invalid licenses in incompatible_license

This gives us an error message (bb.fatal) rather than a traceback due to the
uncaught LicenseError.

Signed-off-by: Christopher Larson <chris_larson at mentor.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/classes/license.bbclass |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index cfb816d..cd18e19 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -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):





More information about the Openembedded-commits mailing list