diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-02-18 15:05:24 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-02-21 22:01:28 +0000 |
commit | 6638a7289e63a62878a70afa1f79616e3e8097cb (patch) | |
tree | 932376e2fb6d4c97c0595a5791b6f51beb04208a /meta/classes | |
parent | 1e599c15d8cbf16657bb932534386c8a664d00e0 (diff) | |
download | poky-6638a7289e63a62878a70afa1f79616e3e8097cb.tar.gz |
licenses: Fix canonical license for 'or-later' handling
GPLv2 and GPLv2+ are two difference licenses with different meanings
and we can't just pretend they're the same thing. Change the code
to treat them separately.
(From OE-Core rev: d1baf74ac92fe0c8c32dff101fd77d77f70fd583)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/license.bbclass | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass index dc91118340..358c716a80 100644 --- a/meta/classes/license.bbclass +++ b/meta/classes/license.bbclass | |||
@@ -252,16 +252,9 @@ def return_spdx(d, license): | |||
252 | def canonical_license(d, license): | 252 | def canonical_license(d, license): |
253 | """ | 253 | """ |
254 | Return the canonical (SPDX) form of the license if available (so GPLv3 | 254 | Return the canonical (SPDX) form of the license if available (so GPLv3 |
255 | becomes GPL-3.0), for the license named 'X+', return canonical form of | 255 | becomes GPL-3.0) or the passed license if there is no canonical form. |
256 | 'X' if available and the tailing '+' (so GPLv3+ becomes GPL-3.0+), | ||
257 | or the passed license if there is no canonical form. | ||
258 | """ | 256 | """ |
259 | lic = d.getVarFlag('SPDXLICENSEMAP', license) or "" | 257 | return d.getVarFlag('SPDXLICENSEMAP', license) or license |
260 | if not lic and license.endswith('+'): | ||
261 | lic = d.getVarFlag('SPDXLICENSEMAP', license.rstrip('+')) | ||
262 | if lic: | ||
263 | lic += '+' | ||
264 | return lic or license | ||
265 | 258 | ||
266 | def available_licenses(d): | 259 | def available_licenses(d): |
267 | """ | 260 | """ |