[oe-commits] Elizabeth Flanagan : license/copyleft: exception for ast parse

git at git.openembedded.org git at git.openembedded.org
Sat Dec 10 00:22:27 UTC 2011


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

Author: Elizabeth Flanagan <elizabeth.flanagan at intel.com>
Date:   Fri Dec  9 16:05:24 2011 -0800

license/copyleft: exception for ast parse

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 at intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

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

diff --git a/meta/classes/copyleft_compliance.bbclass b/meta/classes/copyleft_compliance.bbclass
index 5d9ab11..2fe524b 100644
--- a/meta/classes/copyleft_compliance.bbclass
+++ b/meta/classes/copyleft_compliance.bbclass
@@ -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)
 
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index 96fdb46..4689aaf 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -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"





More information about the Openembedded-commits mailing list