diff options
author | Elizabeth Flanagan <elizabeth.flanagan@intel.com> | 2011-12-09 16:05:24 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-12-10 00:18:15 +0000 |
commit | 924b1e47ab7895e42dd6a56952beb2ef2f61e4fe (patch) | |
tree | 51cbe23425a86798b0cdcea0ee03307bac523b53 /meta | |
parent | 45f6a2106596ffe0ceb54930a61ffeb304ab6702 (diff) | |
download | poky-924b1e47ab7895e42dd6a56952beb2ef2f61e4fe.tar.gz |
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>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/copyleft_compliance.bbclass | 2 | ||||
-rw-r--r-- | 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 5d9ab11926..2fe524b5f3 100644 --- a/meta/classes/copyleft_compliance.bbclass +++ b/meta/classes/copyleft_compliance.bbclass | |||
@@ -48,6 +48,8 @@ def copyleft_should_include(d): | |||
48 | licenses = oe.license.flattened_licenses(d.getVar('LICENSE', True), choose_licenses) | 48 | licenses = oe.license.flattened_licenses(d.getVar('LICENSE', True), choose_licenses) |
49 | except oe.license.InvalidLicense as exc: | 49 | except oe.license.InvalidLicense as exc: |
50 | bb.fatal('%s: %s' % (d.getVar('PF', True), exc)) | 50 | bb.fatal('%s: %s' % (d.getVar('PF', True), exc)) |
51 | except SyntaxError: | ||
52 | bb.warn("%s: Failed to parse it's LICENSE field." % (d.getVar('PF', True))) | ||
51 | 53 | ||
52 | return all(include_license(lic) for lic in licenses) | 54 | return all(include_license(lic) for lic in licenses) |
53 | 55 | ||
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass index 96fdb46155..4689aaf615 100644 --- a/meta/classes/license.bbclass +++ b/meta/classes/license.bbclass | |||
@@ -231,7 +231,10 @@ python do_populate_lic() { | |||
231 | try: | 231 | try: |
232 | v.visit_string(license_types) | 232 | v.visit_string(license_types) |
233 | except oe.license.InvalidLicense as exc: | 233 | except oe.license.InvalidLicense as exc: |
234 | bb.fatal("%s: %s" % (d.getVar('PF', True), exc)) | 234 | bb.fatal('%s: %s' % (d.getVar('PF', True), exc)) |
235 | except SyntaxError: | ||
236 | bb.warn("%s: Failed to parse it's LICENSE field." % (d.getVar('PF', True))) | ||
237 | |||
235 | } | 238 | } |
236 | 239 | ||
237 | SSTATETASKS += "do_populate_lic" | 240 | SSTATETASKS += "do_populate_lic" |