]> code.ossystems Code Review - openembedded-core.git/commitdiff
licenses: Update INCOMPATIBLE_LICENSE for 'or-later' handling
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 18 Feb 2021 15:07:11 +0000 (15:07 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 21 Feb 2021 21:59:52 +0000 (21:59 +0000)
Where a user adds "GPLv3" to INCOMPATIBLE_LICENSE they almost certainly
mean both GPLv3-only and GPLv3-or-later. Update the code to handle this
correctly.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/license.bbclass

index 358c716a801e9fb5518d5cc3f6051349bf1152ff..bcea0b3cb53e4c6df733992578ac80d2b59d78a2 100644 (file)
@@ -281,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: