summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBeth Flanagan <elizabeth.flanagan@intel.com>2015-07-31 15:40:07 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-19 10:51:33 (GMT)
commit55fbde1fdec373a7f8f37981b67a0370175d0a14 (patch)
tree64527243f6faf4fd4799633b8c13e28b58cd65c3
parent3a2725e5d9e90995e137dcda86834090c01e9d0f (diff)
downloadpoky-55fbde1fdec373a7f8f37981b67a0370175d0a14.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) (From OE-Core rev: c468724d2932708dffc766e182a69665de6226f6) Signed-off-by: Beth Flanagan <elizabeth.flanagan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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 ff8c633..714a895 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -434,12 +434,30 @@ python () {
434 bad_licenses = map(lambda l: canonical_license(d, l), bad_licenses) 434 bad_licenses = map(lambda l: canonical_license(d, l), bad_licenses)
435 435
436 whitelist = [] 436 whitelist = []
437 incompatwl = []
438 htincompatwl = []
437 for lic in bad_licenses: 439 for lic in bad_licenses:
440 spdx_license = return_spdx(d, lic)
438 for w in ["HOSTTOOLS_WHITELIST_", "LGPLv2_WHITELIST_", "WHITELIST_"]: 441 for w in ["HOSTTOOLS_WHITELIST_", "LGPLv2_WHITELIST_", "WHITELIST_"]:
439 whitelist.extend((d.getVar(w + lic, True) or "").split()) 442 whitelist.extend((d.getVar(w + lic, True) or "").split())
440 spdx_license = return_spdx(d, lic) 443 if spdx_license:
441 if spdx_license: 444 whitelist.extend((d.getVar(w + spdx_license, True) or "").split())
442 whitelist.extend((d.getVar('HOSTTOOLS_WHITELIST_%s' % spdx_license, True) or "").split()) 445 '''
446 We need to track what we are whitelisting and why. If pn is
447 incompatible and is not HOSTTOOLS_WHITELIST_ we need to be
448 able to note that the image that is created may infact
449 contain incompatible licenses despite INCOMPATIBLE_LICENSE
450 being set.
451 '''
452 if "HOSTTOOLS" in w:
453 htincompatwl.extend((d.getVar(w + lic, True) or "").split())
454 if spdx_license:
455 htincompatwl.extend((d.getVar(w + spdx_license, True) or "").split())
456 else:
457 incompatwl.extend((d.getVar(w + lic, True) or "").split())
458 if spdx_license:
459 incompatwl.extend((d.getVar(w + spdx_license, True) or "").split())
460
443 if not pn in whitelist: 461 if not pn in whitelist:
444 recipe_license = d.getVar('LICENSE', True) 462 recipe_license = d.getVar('LICENSE', True)
445 pkgs = d.getVar('PACKAGES', True).split() 463 pkgs = d.getVar('PACKAGES', True).split()
@@ -460,6 +478,11 @@ python () {
460 elif all_skipped or incompatible_license(d, bad_licenses): 478 elif all_skipped or incompatible_license(d, bad_licenses):
461 bb.debug(1, "SKIPPING recipe %s because it's %s" % (pn, recipe_license)) 479 bb.debug(1, "SKIPPING recipe %s because it's %s" % (pn, recipe_license))
462 raise bb.parse.SkipPackage("incompatible with license %s" % recipe_license) 480 raise bb.parse.SkipPackage("incompatible with license %s" % recipe_license)
481 elif pn in whitelist:
482 if pn in incompatwl:
483 bb.note("INCLUDING " + pn + " as buildable despite INCOMPATIBLE_LICENSE because it has been whitelisted")
484 elif pn in htincompatwl:
485 bb.note("INCLUDING " + pn + " as buildable despite INCOMPATIBLE_LICENSE because it has been whitelisted for HOSTTOOLS")
463 486
464 srcuri = d.getVar('SRC_URI', True) 487 srcuri = d.getVar('SRC_URI', True)
465 # Svn packages should DEPEND on subversion-native 488 # Svn packages should DEPEND on subversion-native