summaryrefslogtreecommitdiff
path: root/poky/meta/classes/license.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'poky/meta/classes/license.bbclass')
-rw-r--r--poky/meta/classes/license.bbclass17
1 files changed, 8 insertions, 9 deletions
diff --git a/poky/meta/classes/license.bbclass b/poky/meta/classes/license.bbclass
index dc9111834..bcea0b3cb 100644
--- a/poky/meta/classes/license.bbclass
+++ b/poky/meta/classes/license.bbclass
@@ -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):
"""
@@ -288,6 +281,12 @@ def expand_wildcard_licenses(d, wildcard_licenses):
wildcards from SPDXLICENSEMAP flags and AVAILABLE_LICENSES.
"""
import fnmatch
+
+ # Assume if we're passed "GPLv3" or "*GPLv3" it means -or-later as well
+ for lic in wildcard_licenses[:]:
+ if not lic.endswith(("-or-later", "-only", "*")):
+ wildcard_licenses.append(lic + "+")
+
licenses = wildcard_licenses[:]
spdxmapkeys = d.getVarFlags('SPDXLICENSEMAP').keys()
for wld_lic in wildcard_licenses: