]> code.ossystems Code Review - openembedded-core.git/commitdiff
license/copyleft: exception for ast parse
authorElizabeth Flanagan <elizabeth.flanagan@intel.com>
Sat, 10 Dec 2011 00:05:24 +0000 (16:05 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 10 Dec 2011 00:17:25 +0000 (00:17 +0000)
As the standard for LICENSE format is not well defined, we
may well run into issues where LICENSE cannot be parsed via
ast. In cases like this, we need to warn and continue.

Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/copyleft_compliance.bbclass
meta/classes/license.bbclass

index 5d9ab119262d06dc48379d04ded42d572dae0e8d..2fe524b5f3093cad2b8fcc2218c3cf30d6ad0c57 100644 (file)
@@ -48,6 +48,8 @@ def copyleft_should_include(d):
         licenses = oe.license.flattened_licenses(d.getVar('LICENSE', True), choose_licenses)
     except oe.license.InvalidLicense as exc:
         bb.fatal('%s: %s' % (d.getVar('PF', True), exc))
+    except SyntaxError:
+        bb.warn("%s: Failed to parse it's LICENSE field." % (d.getVar('PF', True)))
 
     return all(include_license(lic) for lic in licenses)
 
index 96fdb4615579f22b06a626d6a81a9cb62dfc386e..4689aaf615bd069974b2737c98e7902a61857066 100644 (file)
@@ -231,7 +231,10 @@ python do_populate_lic() {
     try:
         v.visit_string(license_types)
     except oe.license.InvalidLicense as exc:
-        bb.fatal("%s: %s" % (d.getVar('PF', True), exc))
+        bb.fatal('%s: %s' % (d.getVar('PF', True), exc))
+    except SyntaxError:
+        bb.warn("%s: Failed to parse it's LICENSE field." % (d.getVar('PF', True)))
+
 }
 
 SSTATETASKS += "do_populate_lic"