summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Larson <chris_larson@mentor.com>2012-01-09 14:40:21 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-01-17 14:53:19 +0000
commit6d73a199e4bbbdab2ae733a40ee22b53c213b10e (patch)
treed6e08fba1418b34973a0b08fcf5eeb9a7871401d
parent7561d5b204aadeae7103148980149dd24c0eae4f (diff)
downloadpoky-6d73a199e4bbbdab2ae733a40ee22b53c213b10e.tar.gz
copyleft_compliance: add control of recipe types to include
In this context, recipe "type" refers to whether it is 'target', 'native', 'cross', etc. COPYLEFT_RECIPE_TYPES is a space separated list of types to include. It defaults to 'target'. (From OE-Core rev: 045e8a409ffe23d4f562b2982bfeee6e45f3c0d9) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/copyleft_compliance.bbclass21
1 files changed, 18 insertions, 3 deletions
diff --git a/meta/classes/copyleft_compliance.bbclass b/meta/classes/copyleft_compliance.bbclass
index 2fe524b5f3..37ed09e955 100644
--- a/meta/classes/copyleft_compliance.bbclass
+++ b/meta/classes/copyleft_compliance.bbclass
@@ -16,6 +16,22 @@ COPYLEFT_LICENSE_EXCLUDE ?= 'CLOSED Proprietary'
16COPYLEFT_LICENSE_EXCLUDE[type] = 'list' 16COPYLEFT_LICENSE_EXCLUDE[type] = 'list'
17COPYLEFT_LICENSE_INCLUDE[doc] = 'Space separated list of globs which exclude licenses' 17COPYLEFT_LICENSE_INCLUDE[doc] = 'Space separated list of globs which exclude licenses'
18 18
19COPYLEFT_RECIPE_TYPE ?= '${@copyleft_recipe_type(d)}'
20COPYLEFT_RECIPE_TYPE[doc] = 'The "type" of the current recipe (e.g. target, native, cross)'
21
22COPYLEFT_RECIPE_TYPES ?= 'target'
23COPYLEFT_RECIPE_TYPES[type] = 'list'
24COPYLEFT_RECIPE_TYPES[doc] = 'Space separated list of recipe types to include'
25
26COPYLEFT_AVAILABLE_RECIPE_TYPES = 'target native nativesdk cross crosssdk cross-canadian'
27COPYLEFT_AVAILABLE_RECIPE_TYPES[type] = 'list'
28COPYLEFT_AVAILABLE_RECIPE_TYPES[doc] = 'Space separated list of available recipe types'
29
30def copyleft_recipe_type(d):
31 for recipe_type in oe.data.typed_value('COPYLEFT_AVAILABLE_RECIPE_TYPES', d):
32 if oe.utils.inherits(d, recipe_type):
33 return recipe_type
34 return 'target'
19 35
20def copyleft_should_include(d): 36def copyleft_should_include(d):
21 """Determine if this recipe's sources should be deployed for compliance""" 37 """Determine if this recipe's sources should be deployed for compliance"""
@@ -23,9 +39,8 @@ def copyleft_should_include(d):
23 import oe.license 39 import oe.license
24 from fnmatch import fnmatchcase as fnmatch 40 from fnmatch import fnmatchcase as fnmatch
25 41
26 if oe.utils.inherits(d, 'native', 'nativesdk', 'cross', 'crossdk'): 42 if d.getVar('COPYLEFT_RECIPE_TYPE', True) not in oe.data.typed_value('COPYLEFT_RECIPE_TYPES', d):
27 # not a target recipe 43 return False
28 return
29 44
30 include = oe.data.typed_value('COPYLEFT_LICENSE_INCLUDE', d) 45 include = oe.data.typed_value('COPYLEFT_LICENSE_INCLUDE', d)
31 exclude = oe.data.typed_value('COPYLEFT_LICENSE_EXCLUDE', d) 46 exclude = oe.data.typed_value('COPYLEFT_LICENSE_EXCLUDE', d)