diff options
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/copyleft_compliance.bbclass | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/meta/classes/copyleft_compliance.bbclass b/meta/classes/copyleft_compliance.bbclass index 37ed09e955..fd046381b6 100644 --- a/meta/classes/copyleft_compliance.bbclass +++ b/meta/classes/copyleft_compliance.bbclass | |||
@@ -39,8 +39,9 @@ def copyleft_should_include(d): | |||
39 | import oe.license | 39 | import oe.license |
40 | from fnmatch import fnmatchcase as fnmatch | 40 | from fnmatch import fnmatchcase as fnmatch |
41 | 41 | ||
42 | if d.getVar('COPYLEFT_RECIPE_TYPE', True) not in oe.data.typed_value('COPYLEFT_RECIPE_TYPES', d): | 42 | recipe_type = d.getVar('COPYLEFT_RECIPE_TYPE', True) |
43 | return False | 43 | if recipe_type not in oe.data.typed_value('COPYLEFT_RECIPE_TYPES', d): |
44 | return False, 'recipe type "%s" is excluded' % recipe_type | ||
44 | 45 | ||
45 | include = oe.data.typed_value('COPYLEFT_LICENSE_INCLUDE', d) | 46 | include = oe.data.typed_value('COPYLEFT_LICENSE_INCLUDE', d) |
46 | exclude = oe.data.typed_value('COPYLEFT_LICENSE_EXCLUDE', d) | 47 | exclude = oe.data.typed_value('COPYLEFT_LICENSE_EXCLUDE', d) |
@@ -63,18 +64,27 @@ def copyleft_should_include(d): | |||
63 | licenses = oe.license.flattened_licenses(d.getVar('LICENSE', True), choose_licenses) | 64 | licenses = oe.license.flattened_licenses(d.getVar('LICENSE', True), choose_licenses) |
64 | except oe.license.InvalidLicense as exc: | 65 | except oe.license.InvalidLicense as exc: |
65 | bb.fatal('%s: %s' % (d.getVar('PF', True), exc)) | 66 | bb.fatal('%s: %s' % (d.getVar('PF', True), exc)) |
66 | except SyntaxError: | 67 | except SyntaxError as exc: |
67 | bb.warn("%s: Failed to parse it's LICENSE field." % (d.getVar('PF', True))) | 68 | bb.warn('%s: error when parsing the LICENSE variable: %s' % (d.getVar('P', True), exc)) |
68 | 69 | else: | |
69 | return all(include_license(lic) for lic in licenses) | 70 | excluded = filter(lambda lic: not include_license(lic), licenses) |
71 | if excluded: | ||
72 | return False, 'recipe has excluded licenses: %s' % ', '.join(excluded) | ||
73 | else: | ||
74 | return True, None | ||
70 | 75 | ||
71 | python do_prepare_copyleft_sources () { | 76 | python do_prepare_copyleft_sources () { |
72 | """Populate a tree of the recipe sources and emit patch series files""" | 77 | """Populate a tree of the recipe sources and emit patch series files""" |
73 | import os.path | 78 | import os.path |
74 | import shutil | 79 | import shutil |
75 | 80 | ||
76 | if not copyleft_should_include(d): | 81 | p = d.getVar('P', True) |
82 | included, reason = copyleft_should_include(d) | ||
83 | if not included: | ||
84 | bb.debug(1, 'copyleft: %s is excluded: %s' % (p, reason)) | ||
77 | return | 85 | return |
86 | else: | ||
87 | bb.debug(1, 'copyleft: %s is included' % p) | ||
78 | 88 | ||
79 | sources_dir = d.getVar('COPYLEFT_SOURCES_DIR', 1) | 89 | sources_dir = d.getVar('COPYLEFT_SOURCES_DIR', 1) |
80 | src_uri = d.getVar('SRC_URI', 1).split() | 90 | src_uri = d.getVar('SRC_URI', 1).split() |