diff options
Diffstat (limited to 'meta/classes/copyleft_compliance.bbclass')
| -rw-r--r-- | meta/classes/copyleft_compliance.bbclass | 21 |
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' | |||
| 16 | COPYLEFT_LICENSE_EXCLUDE[type] = 'list' | 16 | COPYLEFT_LICENSE_EXCLUDE[type] = 'list' |
| 17 | COPYLEFT_LICENSE_INCLUDE[doc] = 'Space separated list of globs which exclude licenses' | 17 | COPYLEFT_LICENSE_INCLUDE[doc] = 'Space separated list of globs which exclude licenses' |
| 18 | 18 | ||
| 19 | COPYLEFT_RECIPE_TYPE ?= '${@copyleft_recipe_type(d)}' | ||
| 20 | COPYLEFT_RECIPE_TYPE[doc] = 'The "type" of the current recipe (e.g. target, native, cross)' | ||
| 21 | |||
| 22 | COPYLEFT_RECIPE_TYPES ?= 'target' | ||
| 23 | COPYLEFT_RECIPE_TYPES[type] = 'list' | ||
| 24 | COPYLEFT_RECIPE_TYPES[doc] = 'Space separated list of recipe types to include' | ||
| 25 | |||
| 26 | COPYLEFT_AVAILABLE_RECIPE_TYPES = 'target native nativesdk cross crosssdk cross-canadian' | ||
| 27 | COPYLEFT_AVAILABLE_RECIPE_TYPES[type] = 'list' | ||
| 28 | COPYLEFT_AVAILABLE_RECIPE_TYPES[doc] = 'Space separated list of available recipe types' | ||
| 29 | |||
| 30 | def 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 | ||
| 20 | def copyleft_should_include(d): | 36 | def 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) |
