diff options
author | Jackie Huang <jackie.huang@windriver.com> | 2014-10-27 03:37:41 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-11-05 12:02:29 +0000 |
commit | 652008fd9dc909836819e5c6808c63643eff6db6 (patch) | |
tree | 1e87e8bd253db1d1eab0f9b784317bdbcddfb6a2 | |
parent | 484502e4e062fae1130a60626f39f5512af4c5c8 (diff) | |
download | openembedded-core-652008fd9dc909836819e5c6808c63643eff6db6.tar.gz openembedded-core-652008fd9dc909836819e5c6808c63643eff6db6.tar.bz2 openembedded-core-652008fd9dc909836819e5c6808c63643eff6db6.zip |
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)
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>
-rw-r--r-- | meta/classes/license.bbclass | 11 |
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): def canonical_license(d, license): """ Return the canonical (SPDX) form of the license if available (so GPLv3 - becomes GPL-3.0), or the passed license if there is no canonical form. + becomes GPL-3.0), for the license named 'X+', return canonical form of + 'X' if availabel and the tailing '+' (so GPLv3+ becomes GPL-3.0+), + or the passed license if there is no canonical form. """ - return d.getVarFlag('SPDXLICENSEMAP', license, True) or license + lic = d.getVarFlag('SPDXLICENSEMAP', license, True) or "" + if not lic and license.endswith('+'): + lic = d.getVarFlag('SPDXLICENSEMAP', license.rstrip('+'), True) + if lic: + lic += '+' + return lic or license def incompatible_license(d, dont_want_licenses, package=None): """ |