1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-30 12:29:55 +00:00

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>
This commit is contained in:
Richard Purdie
2021-02-18 15:05:24 +00:00
parent 1e599c15d8
commit 6638a7289e
2 changed files with 3 additions and 17 deletions
+2 -9
View File
@@ -252,16 +252,9 @@ 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), for the license named 'X+', return canonical form of
'X' if available and the tailing '+' (so GPLv3+ becomes GPL-3.0+),
or the passed license if there is no canonical form.
becomes GPL-3.0) or the passed license if there is no canonical form.
"""
lic = d.getVarFlag('SPDXLICENSEMAP', license) or ""
if not lic and license.endswith('+'):
lic = d.getVarFlag('SPDXLICENSEMAP', license.rstrip('+'))
if lic:
lic += '+'
return lic or license
return d.getVarFlag('SPDXLICENSEMAP', license) or license
def available_licenses(d):
"""