diff options
author | Beth Flanagan <elizabeth.flanagan@intel.com> | 2015-07-31 16:40:07 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-08-01 22:24:08 +0100 |
commit | 5c76072804bfb1c7ea9f62b99d91ac6d76118ee4 (patch) | |
tree | 2bf1ba995c90919bf3921060630a98d30ac4f647 /meta/classes | |
parent | 445c49ce5007eb0c0aa14680c41b79e7764d8882 (diff) | |
download | poky-5c76072804bfb1c7ea9f62b99d91ac6d76118ee4.tar.gz |
base.bbclass: Note when including pn with INCOMPATIBLE_LICENSES
We need to be able to tell people if we WHITELIST a recipe
that contains an incompatible licese.
Example: If we set WHITELIST_GPL-3.0 ?= "foo", foo will end
up on an image even if GPL-3.0 is incompatible. This is the
correct behaviour but there is nothing telling people that it
is even happening.
(From OE-Core rev: c9da529943b2f563b7b0aeb43576c13dd3b6f932)
Signed-off-by: Beth Flanagan <elizabeth.flanagan@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/base.bbclass | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index bfc78dba3a..531b0e72c0 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass | |||
@@ -478,12 +478,30 @@ python () { | |||
478 | bad_licenses = expand_wildcard_licenses(d, bad_licenses) | 478 | bad_licenses = expand_wildcard_licenses(d, bad_licenses) |
479 | 479 | ||
480 | whitelist = [] | 480 | whitelist = [] |
481 | incompatwl = [] | ||
482 | htincompatwl = [] | ||
481 | for lic in bad_licenses: | 483 | for lic in bad_licenses: |
484 | spdx_license = return_spdx(d, lic) | ||
482 | for w in ["HOSTTOOLS_WHITELIST_", "LGPLv2_WHITELIST_", "WHITELIST_"]: | 485 | for w in ["HOSTTOOLS_WHITELIST_", "LGPLv2_WHITELIST_", "WHITELIST_"]: |
483 | whitelist.extend((d.getVar(w + lic, True) or "").split()) | 486 | whitelist.extend((d.getVar(w + lic, True) or "").split()) |
484 | spdx_license = return_spdx(d, lic) | 487 | if spdx_license: |
485 | if spdx_license: | 488 | whitelist.extend((d.getVar(w + spdx_license, True) or "").split()) |
486 | whitelist.extend((d.getVar('HOSTTOOLS_WHITELIST_%s' % spdx_license, True) or "").split()) | 489 | ''' |
490 | We need to track what we are whitelisting and why. If pn is | ||
491 | incompatible and is not HOSTTOOLS_WHITELIST_ we need to be | ||
492 | able to note that the image that is created may infact | ||
493 | contain incompatible licenses despite INCOMPATIBLE_LICENSE | ||
494 | being set. | ||
495 | ''' | ||
496 | if "HOSTTOOLS" in w: | ||
497 | htincompatwl.extend((d.getVar(w + lic, True) or "").split()) | ||
498 | if spdx_license: | ||
499 | htincompatwl.extend((d.getVar(w + spdx_license, True) or "").split()) | ||
500 | else: | ||
501 | incompatwl.extend((d.getVar(w + lic, True) or "").split()) | ||
502 | if spdx_license: | ||
503 | incompatwl.extend((d.getVar(w + spdx_license, True) or "").split()) | ||
504 | |||
487 | if not pn in whitelist: | 505 | if not pn in whitelist: |
488 | recipe_license = d.getVar('LICENSE', True) | 506 | recipe_license = d.getVar('LICENSE', True) |
489 | pkgs = d.getVar('PACKAGES', True).split() | 507 | pkgs = d.getVar('PACKAGES', True).split() |
@@ -504,6 +522,11 @@ python () { | |||
504 | elif all_skipped or incompatible_license(d, bad_licenses): | 522 | elif all_skipped or incompatible_license(d, bad_licenses): |
505 | bb.debug(1, "SKIPPING recipe %s because it's %s" % (pn, recipe_license)) | 523 | bb.debug(1, "SKIPPING recipe %s because it's %s" % (pn, recipe_license)) |
506 | raise bb.parse.SkipPackage("incompatible with license %s" % recipe_license) | 524 | raise bb.parse.SkipPackage("incompatible with license %s" % recipe_license) |
525 | elif pn in whitelist: | ||
526 | if pn in incompatwl: | ||
527 | bb.note("INCLUDING " + pn + " as buildable despite INCOMPATIBLE_LICENSE because it has been whitelisted") | ||
528 | elif pn in htincompatwl: | ||
529 | bb.note("INCLUDING " + pn + " as buildable despite INCOMPATIBLE_LICENSE because it has been whitelisted for HOSTTOOLS") | ||
507 | 530 | ||
508 | srcuri = d.getVar('SRC_URI', True) | 531 | srcuri = d.getVar('SRC_URI', True) |
509 | # Svn packages should DEPEND on subversion-native | 532 | # Svn packages should DEPEND on subversion-native |