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.

(From OE-Core rev: 07f94fa1d661d38b775ce2d99b84e5610c369392)

Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Elizabeth Flanagan 2011-12-09 16:05:24 -08:00 committed by Richard Purdie
parent 45f6a21065
commit 924b1e47ab
2 changed files with 6 additions and 1 deletions

View 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)

View 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"