summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorBeth Flanagan <elizabeth.flanagan@intel.com>2015-07-31 16:40:07 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-01 21:19:42 +0100
commit1f404c9bd87042fc0719f8ebc2a90aaceceaf52a (patch)
tree26462a18f357e82a60ebc94856d48ff11f8b0564 /meta
parente232ad758a0eb0b16c304d4694b0a217cf4da3b8 (diff)
downloadpoky-1f404c9bd87042fc0719f8ebc2a90aaceceaf52a.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 master rev: c9da529943b2f563b7b0aeb43576c13dd3b6f932) (From OE-Core rev: 1b449dd0ee88274d01f2ec1f2a22955b824ff8ef) Signed-off-by: Beth Flanagan <elizabeth.flanagan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Joshua Lock <joshua.lock@collabora.co.uk> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/base.bbclass29
1 files changed, 26 insertions, 3 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 7e2787ae93..effe12eca4 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -476,12 +476,30 @@ python () {
476 bad_licenses = expand_wildcard_licenses(d, bad_licenses) 476 bad_licenses = expand_wildcard_licenses(d, bad_licenses)
477 477
478 whitelist = [] 478 whitelist = []
479 incompatwl = []
480 htincompatwl = []
479 for lic in bad_licenses: 481 for lic in bad_licenses:
482 spdx_license = return_spdx(d, lic)
480 for w in ["HOSTTOOLS_WHITELIST_", "LGPLv2_WHITELIST_", "WHITELIST_"]: 483 for w in ["HOSTTOOLS_WHITELIST_", "LGPLv2_WHITELIST_", "WHITELIST_"]:
481 whitelist.extend((d.getVar(w + lic, True) or "").split()) 484 whitelist.extend((d.getVar(w + lic, True) or "").split())
482 spdx_license = return_spdx(d, lic) 485 if spdx_license:
483 if spdx_license: 486 whitelist.extend((d.getVar(w + spdx_license, True) or "").split())
484 whitelist.extend((d.getVar('HOSTTOOLS_WHITELIST_%s' % spdx_license, True) or "").split()) 487 '''
488 We need to track what we are whitelisting and why. If pn is
489 incompatible and is not HOSTTOOLS_WHITELIST_ we need to be
490 able to note that the image that is created may infact
491 contain incompatible licenses despite INCOMPATIBLE_LICENSE
492 being set.
493 '''
494 if "HOSTTOOLS" in w:
495 htincompatwl.extend((d.getVar(w + lic, True) or "").split())
496 if spdx_license:
497 htincompatwl.extend((d.getVar(w + spdx_license, True) or "").split())
498 else:
499 incompatwl.extend((d.getVar(w + lic, True) or "").split())
500 if spdx_license:
501 incompatwl.extend((d.getVar(w + spdx_license, True) or "").split())
502
485 if not pn in whitelist: 503 if not pn in whitelist:
486 recipe_license = d.getVar('LICENSE', True) 504 recipe_license = d.getVar('LICENSE', True)
487 pkgs = d.getVar('PACKAGES', True).split() 505 pkgs = d.getVar('PACKAGES', True).split()
@@ -502,6 +520,11 @@ python () {
502 elif all_skipped or incompatible_license(d, bad_licenses): 520 elif all_skipped or incompatible_license(d, bad_licenses):
503 bb.debug(1, "SKIPPING recipe %s because it's %s" % (pn, recipe_license)) 521 bb.debug(1, "SKIPPING recipe %s because it's %s" % (pn, recipe_license))
504 raise bb.parse.SkipPackage("incompatible with license %s" % recipe_license) 522 raise bb.parse.SkipPackage("incompatible with license %s" % recipe_license)
523 elif pn in whitelist:
524 if pn in incompatwl:
525 bb.note("INCLUDING " + pn + " as buildable despite INCOMPATIBLE_LICENSE because it has been whitelisted")
526 elif pn in htincompatwl:
527 bb.note("INCLUDING " + pn + " as buildable despite INCOMPATIBLE_LICENSE because it has been whitelisted for HOSTTOOLS")
505 528
506 srcuri = d.getVar('SRC_URI', True) 529 srcuri = d.getVar('SRC_URI', True)
507 # Svn packages should DEPEND on subversion-native 530 # Svn packages should DEPEND on subversion-native