summaryrefslogtreecommitdiffstats
path: root/meta/classes/copyleft_compliance.bbclass
diff options
context:
space:
mode:
authorChristopher Larson <chris_larson@mentor.com>2012-01-09 21:01:57 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-01-17 14:53:19 (GMT)
commit49a0821376ef6146345d673b1e9eddd34aee931a (patch)
treeb24e11770c6f03ad584d5ee3edac89c90f6280a4 /meta/classes/copyleft_compliance.bbclass
parent6d73a199e4bbbdab2ae733a40ee22b53c213b10e (diff)
downloadpoky-49a0821376ef6146345d673b1e9eddd34aee931a.tar.gz
copyleft_compliance: add debug message with the reason for exclusion
(From OE-Core rev: 02101bbe08a5cd6e5eecb21f2095c15ebfe9287f) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/copyleft_compliance.bbclass')
-rw-r--r--meta/classes/copyleft_compliance.bbclass24
1 files changed, 17 insertions, 7 deletions
diff --git a/meta/classes/copyleft_compliance.bbclass b/meta/classes/copyleft_compliance.bbclass
index 37ed09e..fd04638 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
71python do_prepare_copyleft_sources () { 76python 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()