recipetool/devtool: Further SPDX identifier cleanups

Message ID 20220302113802.277757-1-richard.purdie@linuxfoundation.org
State Accepted, archived
Commit 2b0cbafc7854de0308a624b17b8aaba704b031d5
Headers show
Series recipetool/devtool: Further SPDX identifier cleanups | expand

Commit Message

Richard Purdie March 2, 2022, 11:38 a.m. UTC
Some of these are hard to know what to do with since the original source
files for the checksum aren't present. The safe option is to use "-only"
as often the main license is ambiguous and the source files themselves
determine the "or-later" possibility. The "-only" option therefore is
realistically what we need to use in this code.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/lib/oeqa/selftest/cases/oelib/license.py | 22 +++---
 meta/lib/oeqa/selftest/cases/recipetool.py    |  8 +--
 scripts/lib/recipetool/create.py              | 10 +--
 scripts/lib/recipetool/licenses.csv           | 72 +++++++++----------
 4 files changed, 56 insertions(+), 56 deletions(-)

Patch

diff --git a/meta/lib/oeqa/selftest/cases/oelib/license.py b/meta/lib/oeqa/selftest/cases/oelib/license.py
index 6ebbee589fb..3b359396b67 100644
--- a/meta/lib/oeqa/selftest/cases/oelib/license.py
+++ b/meta/lib/oeqa/selftest/cases/oelib/license.py
@@ -15,11 +15,11 @@  class SeenVisitor(oe.license.LicenseVisitor):
 
 class TestSingleLicense(TestCase):
     licenses = [
-        "GPLv2",
-        "LGPL-2.0",
-        "Artistic",
+        "GPL-2.0-only",
+        "LGPL-2.0-only",
+        "Artistic-1.0",
         "MIT",
-        "GPLv3+",
+        "GPL-3.0-or-later",
         "FOO_BAR",
     ]
     invalid_licenses = ["GPL/BSD"]
@@ -67,9 +67,9 @@  class TestComplexCombinations(TestSimpleCombinations):
         "FOO & (BAR | BAZ)&MOO": ["FOO", "BAR", "MOO"],
         "(ALPHA|(BETA&THETA)|OMEGA)&DELTA": ["OMEGA", "DELTA"],
         "((ALPHA|BETA)&FOO)|BAZ": ["BETA", "FOO"],
-        "(GPL-2.0|Proprietary)&BSD-4-clause&MIT": ["GPL-2.0", "BSD-4-clause", "MIT"],
+        "(GPL-2.0-only|Proprietary)&BSD-4-clause&MIT": ["GPL-2.0-only", "BSD-4-clause", "MIT"],
     }
-    preferred = ["BAR", "OMEGA", "BETA", "GPL-2.0"]
+    preferred = ["BAR", "OMEGA", "BETA", "GPL-2.0-only"]
 
 class TestIsIncluded(TestCase):
     tests = {
@@ -87,12 +87,12 @@  class TestIsIncluded(TestCase):
             [True, ["BAR", "FOOBAR"]],
         ("(FOO | BAR) & FOOBAR | BAZ & MOO & BARFOO", None, "FOO"):
             [True, ["BAZ", "MOO", "BARFOO"]],
-        ("GPL-3.0 & GPL-2.0 & LGPL-2.1 | Proprietary", None, None):
-            [True, ["GPL-3.0", "GPL-2.0", "LGPL-2.1"]],
-        ("GPL-3.0 & GPL-2.0 & LGPL-2.1 | Proprietary", None, "GPL-3.0"):
+        ("GPL-3.0-or-later & GPL-2.0-only & LGPL-2.1-only | Proprietary", None, None):
+            [True, ["GPL-3.0-or-later", "GPL-2.0-only", "LGPL-2.1-only"]],
+        ("GPL-3.0-or-later & GPL-2.0-only & LGPL-2.1-only | Proprietary", None, "GPL-3.0-or-later"):
             [True, ["Proprietary"]],
-        ("GPL-3.0 & GPL-2.0 & LGPL-2.1 | Proprietary", None, "GPL-3.0 Proprietary"):
-            [False, ["GPL-3.0"]]
+        ("GPL-3.0-or-later & GPL-2.0-only & LGPL-2.1-only | Proprietary", None, "GPL-3.0-or-later Proprietary"):
+            [False, ["GPL-3.0-or-later"]]
     }
 
     def test_tests(self):
diff --git a/meta/lib/oeqa/selftest/cases/recipetool.py b/meta/lib/oeqa/selftest/cases/recipetool.py
index ca3cf8942d9..510dae6badf 100644
--- a/meta/lib/oeqa/selftest/cases/recipetool.py
+++ b/meta/lib/oeqa/selftest/cases/recipetool.py
@@ -343,7 +343,7 @@  class RecipetoolCreateTests(RecipetoolBase):
         result = runCmd('recipetool create -o %s %s -x %s' % (recipefile, srcuri, tempsrc))
         self.assertTrue(os.path.isfile(recipefile))
         checkvars = {}
-        checkvars['LICENSE'] = 'GPL-2.0'
+        checkvars['LICENSE'] = 'GPL-2.0-only'
         checkvars['LIC_FILES_CHKSUM'] = 'file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263'
         checkvars['SRC_URI'] = 'https://github.com/logrotate/logrotate/releases/download/${PV}/logrotate-${PV}.tar.xz'
         checkvars['SRC_URI[md5sum]'] = 'a560c57fac87c45b2fc17406cdf79288'
@@ -363,7 +363,7 @@  class RecipetoolCreateTests(RecipetoolBase):
         result = runCmd(['recipetool', 'create', '-o', recipefile, srcuri + ";rev=9f7cf8895ae2d39c465c04cc78e918c157420269", '-x', tempsrc])
         self.assertTrue(os.path.isfile(recipefile), 'recipetool did not create recipe file; output:\n%s' % result.output)
         checkvars = {}
-        checkvars['LICENSE'] = 'LGPL-2.1'
+        checkvars['LICENSE'] = 'LGPL-2.1-only'
         checkvars['LIC_FILES_CHKSUM'] = 'file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34'
         checkvars['S'] = '${WORKDIR}/git'
         checkvars['PV'] = '1.11+git${SRCPV}'
@@ -386,7 +386,7 @@  class RecipetoolCreateTests(RecipetoolBase):
             self.fail('recipetool did not create recipe file; output:\n%s\ndirlist:\n%s' % (result.output, str(dirlist)))
         self.assertEqual(dirlist[0], 'socat_%s.bb' % pv, 'Recipe file incorrectly named')
         checkvars = {}
-        checkvars['LICENSE'] = set(['Unknown', 'GPL-2.0'])
+        checkvars['LICENSE'] = set(['Unknown', 'GPL-2.0-only'])
         checkvars['LIC_FILES_CHKSUM'] = set(['file://COPYING.OpenSSL;md5=5c9bccc77f67a8328ef4ebaf468116f4', 'file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263'])
         # We don't check DEPENDS since they are variable for this recipe depending on what's in the sysroot
         checkvars['S'] = None
@@ -402,7 +402,7 @@  class RecipetoolCreateTests(RecipetoolBase):
         result = runCmd('recipetool create -o %s %s' % (temprecipe, srcuri))
         self.assertTrue(os.path.isfile(recipefile))
         checkvars = {}
-        checkvars['LICENSE'] = set(['LGPL-2.1', 'MPL-1.1'])
+        checkvars['LICENSE'] = set(['LGPL-2.1-only', 'MPL-1.1-only'])
         checkvars['SRC_URI'] = 'http://taglib.github.io/releases/taglib-${PV}.tar.gz'
         checkvars['SRC_URI[md5sum]'] = 'cee7be0ccfc892fa433d6c837df9522a'
         checkvars['SRC_URI[sha256sum]'] = 'b6d1a5a610aae6ff39d93de5efd0fdc787aa9e9dc1e7026fa4c961b26563526b'
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index 0b5d5466ba5..220465ed2f4 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -1108,15 +1108,15 @@  def crunch_license(licfile):
     # https://github.com/waffle-gl/waffle/blob/master/LICENSE.txt
     crunched_md5sums['50fab24ce589d69af8964fdbfe414c60'] = 'BSD-2-Clause'
     # https://github.com/spigwitmer/fakeds1963s/blob/master/LICENSE
-    crunched_md5sums['88a4355858a1433fea99fae34a44da88'] = 'GPL-2.0'
+    crunched_md5sums['88a4355858a1433fea99fae34a44da88'] = 'GPL-2.0-only'
     # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
-    crunched_md5sums['063b5c3ebb5f3aa4c85a2ed18a31fbe7'] = 'GPL-2.0'
+    crunched_md5sums['063b5c3ebb5f3aa4c85a2ed18a31fbe7'] = 'GPL-2.0-only'
     # https://github.com/FFmpeg/FFmpeg/blob/master/COPYING.LGPLv2.1
-    crunched_md5sums['7f5202f4d44ed15dcd4915f5210417d8'] = 'LGPL-2.1'
+    crunched_md5sums['7f5202f4d44ed15dcd4915f5210417d8'] = 'LGPL-2.1-only'
     # unixODBC-2.3.4 COPYING
-    crunched_md5sums['3debde09238a8c8e1f6a847e1ec9055b'] = 'LGPL-2.1'
+    crunched_md5sums['3debde09238a8c8e1f6a847e1ec9055b'] = 'LGPL-2.1-only'
     # https://github.com/FFmpeg/FFmpeg/blob/master/COPYING.LGPLv3
-    crunched_md5sums['f90c613c51aa35da4d79dd55fc724ceb'] = 'LGPL-3.0'
+    crunched_md5sums['f90c613c51aa35da4d79dd55fc724ceb'] = 'LGPL-3.0-only'
     # https://raw.githubusercontent.com/eclipse/mosquitto/v1.4.14/epl-v10
     crunched_md5sums['efe2cb9a35826992b9df68224e3c2628'] = 'EPL-1.0'
 
diff --git a/scripts/lib/recipetool/licenses.csv b/scripts/lib/recipetool/licenses.csv
index 2a8fdfac05f..9bc11d39a11 100644
--- a/scripts/lib/recipetool/licenses.csv
+++ b/scripts/lib/recipetool/licenses.csv
@@ -1,37 +1,37 @@ 
-0636e73ff0215e8d672dc4c32c317bb3,GPL-2.0
-12f884d2ae1ff87c09e5b7ccc2c4ca7e,GPL-2.0
-18810669f13b87348459e611d31ab760,GPL-2.0
-252890d9eee26aab7b432e8b8a616475,LGPL-2.0
-2d5025d4aa3495befef8f17206a5b0a1,LGPL-2.1
-3214f080875748938ba060314b4f727d,LGPL-2.0
-385c55653886acac3821999a3ccd17b3,Artistic-1.0 | GPL-2.0
-393a5ca445f6965873eca0259a17f833,GPL-2.0
-3b83ef96387f14655fc854ddc3c6bd57,Apache-2.0
-3bf50002aefd002f49e7bb854063f7e7,LGPL-2.0
-4325afd396febcb659c36b49533135d4,GPL-2.0
-4fbd65380cdd255951079008b364516c,LGPL-2.1
+0636e73ff0215e8d672dc4c32c317bb3,GPL-2.0-only
+12f884d2ae1ff87c09e5b7ccc2c4ca7e,GPL-2.0-only
+18810669f13b87348459e611d31ab760,GPL-2.0-only
+252890d9eee26aab7b432e8b8a616475,LGPL-2.0-only
+2d5025d4aa3495befef8f17206a5b0a1,LGPL-2.1-only
+3214f080875748938ba060314b4f727d,LGPL-2.0-only
+385c55653886acac3821999a3ccd17b3,Artistic-1.0 | GPL-2.0-only
+393a5ca445f6965873eca0259a17f833,GPL-2.0-only
+3b83ef96387f14655fc854ddc3c6bd57,Apache-2.0-only
+3bf50002aefd002f49e7bb854063f7e7,LGPL-2.0-only
+4325afd396febcb659c36b49533135d4,GPL-2.0-only
+4fbd65380cdd255951079008b364516c,LGPL-2.1-only
 54c7042be62e169199200bc6477f04d1,BSD-3-Clause
-55ca817ccb7d5b5b66355690e9abc605,LGPL-2.0
-59530bdf33659b29e73d4adb9f9f6552,GPL-2.0
-5f30f0716dfdd0d91eb439ebec522ec2,LGPL-2.0
-6a6a8e020838b23406c81b19c1d46df6,LGPL-3
-751419260aa954499f7abaabaa882bbe,GPL-2.0
-7fbc338309ac38fefcd64b04bb903e34,LGPL-2.1
-8ca43cbc842c2336e835926c2166c28b,GPL-2.0
-94d55d512a9ba36caa9b7df079bae19f,GPL-2.0
-9ac2e7cff1ddaf48b6eab6028f23ef88,GPL-2.0
-9f604d8a4f8e74f4f5140845a21b6674,LGPL-2.0
-a6f89e2100d9b6cdffcea4f398e37343,LGPL-2.1
-b234ee4d69f5fce4486a80fdaf4a4263,GPL-2.0
-bbb461211a33b134d42ed5ee802b37ff,LGPL-2.1
-bfe1f75d606912a4111c90743d6c7325,MPL-1.1
-c93c0550bd3173f4504b2cbd8991e50b,GPL-2.0
-d32239bcb673463ab874e80d47fae504,GPL-3.0
-d7810fab7487fb0aad327b76f1be7cd7,GPL-2.0
-d8045f3b8f929c1cb29a1e3fd737b499,LGPL-2.1
-db979804f025cf55aabec7129cb671ed,LGPL-2.0
-eb723b61539feef013de476e68b5c50a,GPL-2.0
-ebb5c50ab7cab4baeffba14977030c07,GPL-2.0
-f27defe1e96c2e1ecd4e0c9be8967949,GPL-3.0
-fad9b3332be894bab9bc501572864b29,LGPL-2.1
-fbc093901857fcd118f065f900982c24,LGPL-2.1
+55ca817ccb7d5b5b66355690e9abc605,LGPL-2.0-only
+59530bdf33659b29e73d4adb9f9f6552,GPL-2.0-only
+5f30f0716dfdd0d91eb439ebec522ec2,LGPL-2.0-only
+6a6a8e020838b23406c81b19c1d46df6,LGPL-3.0-only
+751419260aa954499f7abaabaa882bbe,GPL-2.0-only
+7fbc338309ac38fefcd64b04bb903e34,LGPL-2.1-only
+8ca43cbc842c2336e835926c2166c28b,GPL-2.0-only
+94d55d512a9ba36caa9b7df079bae19f,GPL-2.0-only
+9ac2e7cff1ddaf48b6eab6028f23ef88,GPL-2.0-only
+9f604d8a4f8e74f4f5140845a21b6674,LGPL-2.0-only
+a6f89e2100d9b6cdffcea4f398e37343,LGPL-2.1-only
+b234ee4d69f5fce4486a80fdaf4a4263,GPL-2.0-only
+bbb461211a33b134d42ed5ee802b37ff,LGPL-2.1-only
+bfe1f75d606912a4111c90743d6c7325,MPL-1.1-only
+c93c0550bd3173f4504b2cbd8991e50b,GPL-2.0-only
+d32239bcb673463ab874e80d47fae504,GPL-3.0-only
+d7810fab7487fb0aad327b76f1be7cd7,GPL-2.0-only
+d8045f3b8f929c1cb29a1e3fd737b499,LGPL-2.1-only
+db979804f025cf55aabec7129cb671ed,LGPL-2.0-only
+eb723b61539feef013de476e68b5c50a,GPL-2.0-only
+ebb5c50ab7cab4baeffba14977030c07,GPL-2.0-only
+f27defe1e96c2e1ecd4e0c9be8967949,GPL-3.0-only
+fad9b3332be894bab9bc501572864b29,LGPL-2.1-only
+fbc093901857fcd118f065f900982c24,LGPL-2.1-only