summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorJackie Huang <jackie.huang@windriver.com>2014-10-27 03:37:41 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-11-05 12:03:16 +0000
commitf3a177cf045b19612b7d2c96889ac24307191c3d (patch)
treea911d8234a059ff7c473078b96350980b6b0822a /meta/classes
parent58a629a1a0091c1b61dc86a6ebad832e79c98ed3 (diff)
downloadpoky-f3a177cf045b19612b7d2c96889ac24307191c3d.tar.gz
license.bbclass: canonicalise the licenses named with 'X+'
If INCOMPATIBLE_LICENSE=GPLv3, GPLv3+ should be excluded as well but not now since there is no SPDXLICENSEMAP for licenses named with 'X+', we can add all the SPDXLICENSEMAP settings for licenses named with 'X+' in licenses.conf, but it's more like a duplication, so improve the canonical_license function to auto map for 'X+' if SPDXLICENSEMAP for 'X' is available, so GPLv3+ becomes GPL-3.0+. (From OE-Core rev: 1d6dab1dbbbfbcb32e58dba3111130157ef2b24f) (From OE-Core rev: 652008fd9dc909836819e5c6808c63643eff6db6) Signed-off-by: Jackie Huang <jackie.huang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/license.bbclass11
1 files changed, 9 insertions, 2 deletions
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index a34ea39493..14d3107c4a 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -274,9 +274,16 @@ def return_spdx(d, license):
274def canonical_license(d, license): 274def canonical_license(d, license):
275 """ 275 """
276 Return the canonical (SPDX) form of the license if available (so GPLv3 276 Return the canonical (SPDX) form of the license if available (so GPLv3
277 becomes GPL-3.0), or the passed license if there is no canonical form. 277 becomes GPL-3.0), for the license named 'X+', return canonical form of
278 'X' if availabel and the tailing '+' (so GPLv3+ becomes GPL-3.0+),
279 or the passed license if there is no canonical form.
278 """ 280 """
279 return d.getVarFlag('SPDXLICENSEMAP', license, True) or license 281 lic = d.getVarFlag('SPDXLICENSEMAP', license, True) or ""
282 if not lic and license.endswith('+'):
283 lic = d.getVarFlag('SPDXLICENSEMAP', license.rstrip('+'), True)
284 if lic:
285 lic += '+'
286 return lic or license
280 287
281def incompatible_license(d, dont_want_licenses, package=None): 288def incompatible_license(d, dont_want_licenses, package=None):
282 """ 289 """