diff options
| -rw-r--r-- | meta/classes/license.bbclass | 11 | ||||
| -rw-r--r-- | meta/lib/oe/license.py | 9 |
2 files changed, 3 insertions, 17 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 | """ |
diff --git a/meta/lib/oe/license.py b/meta/lib/oe/license.py index c1274a61de..665d32ecbb 100644 --- a/meta/lib/oe/license.py +++ b/meta/lib/oe/license.py | |||
| @@ -10,14 +10,7 @@ from fnmatch import fnmatchcase as fnmatch | |||
| 10 | def license_ok(license, dont_want_licenses): | 10 | def license_ok(license, dont_want_licenses): |
| 11 | """ Return False if License exist in dont_want_licenses else True """ | 11 | """ Return False if License exist in dont_want_licenses else True """ |
| 12 | for dwl in dont_want_licenses: | 12 | for dwl in dont_want_licenses: |
| 13 | # If you want to exclude license named generically 'X', we | 13 | if fnmatch(license, dwl): |
| 14 | # surely want to exclude 'X+' as well. In consequence, we | ||
| 15 | # will exclude a trailing '+' character from LICENSE in | ||
| 16 | # case INCOMPATIBLE_LICENSE is not a 'X+' license. | ||
| 17 | lic = license | ||
| 18 | if not re.search(r'\+$', dwl): | ||
| 19 | lic = re.sub(r'\+', '', license) | ||
| 20 | if fnmatch(lic, dwl): | ||
| 21 | return False | 14 | return False |
| 22 | return True | 15 | return True |
| 23 | 16 | ||
