diff options
author | André Draszik <adraszik@tycoint.com> | 2017-10-06 13:12:49 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-11-05 22:39:47 +0000 |
commit | 5399eb56366f3966cdff026bf47af27746120031 (patch) | |
tree | 0e07f43ea3449dd3cb4d37cde02e43804aea7244 /meta | |
parent | 0c9925f2291b2eeb57958b4cf836ddeda9d710b4 (diff) | |
download | poky-5399eb56366f3966cdff026bf47af27746120031.tar.gz |
copyleft_filter.bbclass: restore possiblity to filter on type
Since the changes introduced in ae9102bda398
("copyleft_filter.bbclass: Allow to filter on name"), it is
impossible to filter on the recipe type, all recipes are
treated as though they should be included if the license
matches, irrespective of the COPYLEFT_RECIPE_TYPES
variable.
Fix this.
(From OE-Core rev: 23b520c42e93e47e3a19037877281af673144b31)
Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
(cherry picked from commit e612dfa520c7d7ecf58006e82189be601204f38d)
Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/copyleft_filter.bbclass | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/meta/classes/copyleft_filter.bbclass b/meta/classes/copyleft_filter.bbclass index 5867bb9f7e..c36bce431a 100644 --- a/meta/classes/copyleft_filter.bbclass +++ b/meta/classes/copyleft_filter.bbclass | |||
@@ -47,27 +47,27 @@ def copyleft_should_include(d): | |||
47 | import oe.license | 47 | import oe.license |
48 | from fnmatch import fnmatchcase as fnmatch | 48 | from fnmatch import fnmatchcase as fnmatch |
49 | 49 | ||
50 | included, motive = False, 'recipe did not match anything' | ||
51 | |||
52 | recipe_type = d.getVar('COPYLEFT_RECIPE_TYPE') | 50 | recipe_type = d.getVar('COPYLEFT_RECIPE_TYPE') |
53 | if recipe_type not in oe.data.typed_value('COPYLEFT_RECIPE_TYPES', d): | 51 | if recipe_type not in oe.data.typed_value('COPYLEFT_RECIPE_TYPES', d): |
54 | include, motive = False, 'recipe type "%s" is excluded' % recipe_type | 52 | included, motive = False, 'recipe type "%s" is excluded' % recipe_type |
53 | else: | ||
54 | included, motive = False, 'recipe did not match anything' | ||
55 | 55 | ||
56 | include = oe.data.typed_value('COPYLEFT_LICENSE_INCLUDE', d) | 56 | include = oe.data.typed_value('COPYLEFT_LICENSE_INCLUDE', d) |
57 | exclude = oe.data.typed_value('COPYLEFT_LICENSE_EXCLUDE', d) | 57 | exclude = oe.data.typed_value('COPYLEFT_LICENSE_EXCLUDE', d) |
58 | 58 | ||
59 | try: | 59 | try: |
60 | is_included, reason = oe.license.is_included(d.getVar('LICENSE'), include, exclude) | 60 | is_included, reason = oe.license.is_included(d.getVar('LICENSE'), include, exclude) |
61 | except oe.license.LicenseError as exc: | 61 | except oe.license.LicenseError as exc: |
62 | bb.fatal('%s: %s' % (d.getVar('PF'), exc)) | 62 | bb.fatal('%s: %s' % (d.getVar('PF'), exc)) |
63 | else: | ||
64 | if is_included: | ||
65 | if reason: | ||
66 | included, motive = True, 'recipe has included licenses: %s' % ', '.join(reason) | ||
67 | else: | ||
68 | included, motive = False, 'recipe does not include a copyleft license' | ||
69 | else: | 63 | else: |
70 | included, motive = False, 'recipe has excluded licenses: %s' % ', '.join(reason) | 64 | if is_included: |
65 | if reason: | ||
66 | included, motive = True, 'recipe has included licenses: %s' % ', '.join(reason) | ||
67 | else: | ||
68 | included, motive = False, 'recipe does not include a copyleft license' | ||
69 | else: | ||
70 | included, motive = False, 'recipe has excluded licenses: %s' % ', '.join(reason) | ||
71 | 71 | ||
72 | if any(fnmatch(d.getVar('PN'), name) \ | 72 | if any(fnmatch(d.getVar('PN'), name) \ |
73 | for name in oe.data.typed_value('COPYLEFT_PN_INCLUDE', d)): | 73 | for name in oe.data.typed_value('COPYLEFT_PN_INCLUDE', d)): |