[elbe-devel] [PATCH v2 03/11] tests: example-mapping: provide mapping for GPL-3

Thomas Weißschuh thomas.weissschuh at linutronix.de
Wed Jul 24 12:21:59 CEST 2024


This is a direct match.
As the example-mapping can also be used as reference by users, make sure
its useful.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 elbepack/tests/cyclonedx/example-mapping.xml    |  1 +
 elbepack/tests/test_parselicence.py             |  2 +-
 elbepack/tests/test_parselicence_reference.spdx | 16 +++++++--------
 elbepack/tests/test_parselicence_reference.xml  | 26 +++++++++----------------
 4 files changed, 19 insertions(+), 26 deletions(-)

diff --git a/elbepack/tests/cyclonedx/example-mapping.xml b/elbepack/tests/cyclonedx/example-mapping.xml
index cf04f1970011..d7dbbde7fbc0 100644
--- a/elbepack/tests/cyclonedx/example-mapping.xml
+++ b/elbepack/tests/cyclonedx/example-mapping.xml
@@ -8,6 +8,7 @@
                 <mapping name='GPLv2+'>GPL-2.0-or-later</mapping>
                 <mapping name='GPL-2.0+'>GPL-2.0-or-later</mapping>
                 <mapping name='GPL-2.1+'>GPL-2.1-or-later</mapping>
+                <mapping name='GPL-3'>GPL-3.0-only</mapping>
                 <mapping name='GPL-3+'>GPL-3.0-or-later</mapping>
                 <mapping name='GPLv3+'>GPL-3.0-or-later</mapping>
                 <mapping name='GPL-3.0+'>GPL-3.0-or-later</mapping>
diff --git a/elbepack/tests/test_parselicence.py b/elbepack/tests/test_parselicence.py
index 342b57043521..f4c2441b0094 100644
--- a/elbepack/tests/test_parselicence.py
+++ b/elbepack/tests/test_parselicence.py
@@ -27,7 +27,7 @@ def test_parselicence(tmp_path):
         here.joinpath('cyclonedx', 'build-simple-example', 'licence-target.xml'),
     ], check=True, capture_output=True)
 
-    assert ps.stdout == b'statistics:\nnum:156 mr:137 hr:3 err_pkg:99\n'
+    assert ps.stdout == b'statistics:\nnum:156 mr:137 hr:3 err_pkg:98\n'
 
     xml_reference = here.joinpath('test_parselicence_reference.xml')
     assert xml_output.read_text() == xml_reference.read_text()
diff --git a/elbepack/tests/test_parselicence_reference.spdx b/elbepack/tests/test_parselicence_reference.spdx
index bef82d10a6c6..a5bdaf086bf7 100644
--- a/elbepack/tests/test_parselicence_reference.spdx
+++ b/elbepack/tests/test_parselicence_reference.spdx
@@ -362,7 +362,7 @@ PackageLicenseInfoFromFiles: NOASSERTION
 PackageName: libcap-ng0
 PackageDownloadLocation: NOASSERTION
 PackageLicenseConcluded: NOASSERTION
-PackageLicenseDeclared: LGPL-2.1-or-later AND GPL-2.0-or-later AND UNKNOWN_MAPPING(GPL-3)
+PackageLicenseDeclared: LGPL-2.1-or-later AND GPL-2.0-or-later AND GPL-3.0-only
 PackageLicenseInfoFromFiles: NOASSERTION
 
 ## Package libcap2
@@ -404,7 +404,7 @@ PackageLicenseInfoFromFiles: NOASSERTION
 PackageName: libdb5.3
 PackageDownloadLocation: NOASSERTION
 PackageLicenseConcluded: NOASSERTION
-PackageLicenseDeclared: UNKNOWN_MAPPING(Sleepycat) AND BSD-3-Clause AND BSD-3-Clause AND UNKNOWN_MAPPING(Ms-PL) AND (UNKNOWN_MAPPING(GPL) OR Artistic-1.0) AND UNKNOWN_MAPPING(X11) AND UNKNOWN_MAPPING(MIT-old) AND UNKNOWN_MAPPING(TCL-like) AND UNKNOWN_MAPPING(BSD-3-clause-fjord) AND UNKNOWN_MAPPING(GPL-3) AND UNKNOWN_MAPPING(zlib) AND (Artistic-1.0 OR BSD-3-Clause) AND UNKNOWN_MAPPING(GPL)
+PackageLicenseDeclared: UNKNOWN_MAPPING(Sleepycat) AND BSD-3-Clause AND BSD-3-Clause AND UNKNOWN_MAPPING(Ms-PL) AND (UNKNOWN_MAPPING(GPL) OR Artistic-1.0) AND UNKNOWN_MAPPING(X11) AND UNKNOWN_MAPPING(MIT-old) AND UNKNOWN_MAPPING(TCL-like) AND UNKNOWN_MAPPING(BSD-3-clause-fjord) AND GPL-3.0-only AND UNKNOWN_MAPPING(zlib) AND (Artistic-1.0 OR BSD-3-Clause) AND UNKNOWN_MAPPING(GPL)
 PackageLicenseInfoFromFiles: NOASSERTION
 
 ## Package libdebconfclient0
@@ -656,28 +656,28 @@ PackageLicenseInfoFromFiles: NOASSERTION
 PackageName: libpam-modules
 PackageDownloadLocation: NOASSERTION
 PackageLicenseConcluded: NOASSERTION
-PackageLicenseDeclared: (BSD-3-Clause OR UNKNOWN_MAPPING(GPL)) AND GPL-2.0-only AND GPL-2.0-or-later AND UNKNOWN_MAPPING(GPL-3) AND GPL-3.0-or-later WITH Bison exception AND UNKNOWN_MAPPING(BSD-tcp_wrappers) AND LGPL-2.0-or-later AND CC0-1.0 AND UNKNOWN_MAPPING(Beerware)
+PackageLicenseDeclared: (BSD-3-Clause OR UNKNOWN_MAPPING(GPL)) AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-only AND GPL-3.0-or-later WITH Bison exception AND UNKNOWN_MAPPING(BSD-tcp_wrappers) AND LGPL-2.0-or-later AND CC0-1.0 AND UNKNOWN_MAPPING(Beerware)
 PackageLicenseInfoFromFiles: NOASSERTION
 
 ## Package libpam-modules-bin
 PackageName: libpam-modules-bin
 PackageDownloadLocation: NOASSERTION
 PackageLicenseConcluded: NOASSERTION
-PackageLicenseDeclared: (BSD-3-Clause OR UNKNOWN_MAPPING(GPL)) AND GPL-2.0-only AND GPL-2.0-or-later AND UNKNOWN_MAPPING(GPL-3) AND GPL-3.0-or-later WITH Bison exception AND UNKNOWN_MAPPING(BSD-tcp_wrappers) AND LGPL-2.0-or-later AND CC0-1.0 AND UNKNOWN_MAPPING(Beerware)
+PackageLicenseDeclared: (BSD-3-Clause OR UNKNOWN_MAPPING(GPL)) AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-only AND GPL-3.0-or-later WITH Bison exception AND UNKNOWN_MAPPING(BSD-tcp_wrappers) AND LGPL-2.0-or-later AND CC0-1.0 AND UNKNOWN_MAPPING(Beerware)
 PackageLicenseInfoFromFiles: NOASSERTION
 
 ## Package libpam-runtime
 PackageName: libpam-runtime
 PackageDownloadLocation: NOASSERTION
 PackageLicenseConcluded: NOASSERTION
-PackageLicenseDeclared: (BSD-3-Clause OR UNKNOWN_MAPPING(GPL)) AND GPL-2.0-only AND GPL-2.0-or-later AND UNKNOWN_MAPPING(GPL-3) AND GPL-3.0-or-later WITH Bison exception AND UNKNOWN_MAPPING(BSD-tcp_wrappers) AND LGPL-2.0-or-later AND CC0-1.0 AND UNKNOWN_MAPPING(Beerware)
+PackageLicenseDeclared: (BSD-3-Clause OR UNKNOWN_MAPPING(GPL)) AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-only AND GPL-3.0-or-later WITH Bison exception AND UNKNOWN_MAPPING(BSD-tcp_wrappers) AND LGPL-2.0-or-later AND CC0-1.0 AND UNKNOWN_MAPPING(Beerware)
 PackageLicenseInfoFromFiles: NOASSERTION
 
 ## Package libpam0g
 PackageName: libpam0g
 PackageDownloadLocation: NOASSERTION
 PackageLicenseConcluded: NOASSERTION
-PackageLicenseDeclared: (BSD-3-Clause OR UNKNOWN_MAPPING(GPL)) AND GPL-2.0-only AND GPL-2.0-or-later AND UNKNOWN_MAPPING(GPL-3) AND GPL-3.0-or-later WITH Bison exception AND UNKNOWN_MAPPING(BSD-tcp_wrappers) AND LGPL-2.0-or-later AND CC0-1.0 AND UNKNOWN_MAPPING(Beerware)
+PackageLicenseDeclared: (BSD-3-Clause OR UNKNOWN_MAPPING(GPL)) AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-only AND GPL-3.0-or-later WITH Bison exception AND UNKNOWN_MAPPING(BSD-tcp_wrappers) AND LGPL-2.0-or-later AND CC0-1.0 AND UNKNOWN_MAPPING(Beerware)
 PackageLicenseInfoFromFiles: NOASSERTION
 
 ## Package libpcre2-8-0
@@ -705,7 +705,7 @@ PackageLicenseInfoFromFiles: NOASSERTION
 PackageName: libreadline8
 PackageDownloadLocation: NOASSERTION
 PackageLicenseConcluded: NOASSERTION
-PackageLicenseDeclared: GPL-3.0-or-later AND GPL-2.0-or-later AND UNKNOWN_MAPPING(GFDL-NIV-1.3+) AND UNKNOWN_MAPPING(ISC-no-attribution) AND UNKNOWN_MAPPING(GPL-3)
+PackageLicenseDeclared: GPL-3.0-or-later AND GPL-2.0-or-later AND UNKNOWN_MAPPING(GFDL-NIV-1.3+) AND UNKNOWN_MAPPING(ISC-no-attribution) AND GPL-3.0-only
 PackageLicenseInfoFromFiles: NOASSERTION
 
 ## Package libseccomp2
@@ -978,7 +978,7 @@ PackageLicenseInfoFromFiles: NOASSERTION
 PackageName: readline-common
 PackageDownloadLocation: NOASSERTION
 PackageLicenseConcluded: NOASSERTION
-PackageLicenseDeclared: GPL-3.0-or-later AND GPL-2.0-or-later AND UNKNOWN_MAPPING(GFDL-NIV-1.3+) AND UNKNOWN_MAPPING(ISC-no-attribution) AND UNKNOWN_MAPPING(GPL-3)
+PackageLicenseDeclared: GPL-3.0-or-later AND GPL-2.0-or-later AND UNKNOWN_MAPPING(GFDL-NIV-1.3+) AND UNKNOWN_MAPPING(ISC-no-attribution) AND GPL-3.0-only
 PackageLicenseInfoFromFiles: NOASSERTION
 
 ## Package sed
diff --git a/elbepack/tests/test_parselicence_reference.xml b/elbepack/tests/test_parselicence_reference.xml
index aefe1cca53a6..3e8d94bcec88 100644
--- a/elbepack/tests/test_parselicence_reference.xml
+++ b/elbepack/tests/test_parselicence_reference.xml
@@ -14866,9 +14866,8 @@ License: GPL-2+
 <spdx_licenses>
 <license>LGPL-2.1-or-later</license>
 <license>GPL-2.0-or-later</license>
-<license>UNKNOWN_MAPPING(GPL-3)</license>
-</spdx_licenses><error>no mapping for "GPL-3" for pkg "libcap-ng0"</error>
-</pkglicense>
+<license>GPL-3.0-only</license>
+</spdx_licenses></pkglicense>
 <pkglicense name="libcap2"><text>Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 Upstream-Name: libcap
 Upstream-Contact: Andrew G. Morgan <morgan at kernel.org>
@@ -16905,7 +16904,7 @@ License: Sleepycat and BSD-3-clause
 <license>UNKNOWN_MAPPING(MIT-old)</license>
 <license>UNKNOWN_MAPPING(TCL-like)</license>
 <license>UNKNOWN_MAPPING(BSD-3-clause-fjord)</license>
-<license>UNKNOWN_MAPPING(GPL-3)</license>
+<license>GPL-3.0-only</license>
 <license>UNKNOWN_MAPPING(zlib)</license>
 <license>Artistic-1.0 OR BSD-3-Clause</license>
 <license>UNKNOWN_MAPPING(GPL)</license>
@@ -16916,7 +16915,6 @@ License: Sleepycat and BSD-3-clause
 <error>no mapping for "MIT-old" for pkg "libdb5.3"</error>
 <error>no mapping for "TCL-like" for pkg "libdb5.3"</error>
 <error>no mapping for "BSD-3-clause-fjord" for pkg "libdb5.3"</error>
-<error>no mapping for "GPL-3" for pkg "libdb5.3"</error>
 <error>no mapping for "zlib" for pkg "libdb5.3"</error>
 <error>no mapping for "GPL" for pkg "libdb5.3"</error>
 </pkglicense>
@@ -36368,14 +36366,13 @@ License: Beerware
 <license>BSD-3-Clause OR UNKNOWN_MAPPING(GPL)</license>
 <license>GPL-2.0-only</license>
 <license>GPL-2.0-or-later</license>
-<license>UNKNOWN_MAPPING(GPL-3)</license>
+<license>GPL-3.0-only</license>
 <license>GPL-3.0-or-later WITH Bison exception</license>
 <license>UNKNOWN_MAPPING(BSD-tcp_wrappers)</license>
 <license>LGPL-2.0-or-later</license>
 <license>CC0-1.0</license>
 <license>UNKNOWN_MAPPING(Beerware)</license>
 </spdx_licenses><error>no mapping for "GPL" for pkg "libpam-modules"</error>
-<error>no mapping for "GPL-3" for pkg "libpam-modules"</error>
 <error>no mapping for "BSD-tcp_wrappers" for pkg "libpam-modules"</error>
 <error>no mapping for "Beerware" for pkg "libpam-modules"</error>
 </pkglicense>
@@ -36674,14 +36671,13 @@ License: Beerware
 <license>BSD-3-Clause OR UNKNOWN_MAPPING(GPL)</license>
 <license>GPL-2.0-only</license>
 <license>GPL-2.0-or-later</license>
-<license>UNKNOWN_MAPPING(GPL-3)</license>
+<license>GPL-3.0-only</license>
 <license>GPL-3.0-or-later WITH Bison exception</license>
 <license>UNKNOWN_MAPPING(BSD-tcp_wrappers)</license>
 <license>LGPL-2.0-or-later</license>
 <license>CC0-1.0</license>
 <license>UNKNOWN_MAPPING(Beerware)</license>
 </spdx_licenses><error>no mapping for "GPL" for pkg "libpam-modules-bin"</error>
-<error>no mapping for "GPL-3" for pkg "libpam-modules-bin"</error>
 <error>no mapping for "BSD-tcp_wrappers" for pkg "libpam-modules-bin"</error>
 <error>no mapping for "Beerware" for pkg "libpam-modules-bin"</error>
 </pkglicense>
@@ -36980,14 +36976,13 @@ License: Beerware
 <license>BSD-3-Clause OR UNKNOWN_MAPPING(GPL)</license>
 <license>GPL-2.0-only</license>
 <license>GPL-2.0-or-later</license>
-<license>UNKNOWN_MAPPING(GPL-3)</license>
+<license>GPL-3.0-only</license>
 <license>GPL-3.0-or-later WITH Bison exception</license>
 <license>UNKNOWN_MAPPING(BSD-tcp_wrappers)</license>
 <license>LGPL-2.0-or-later</license>
 <license>CC0-1.0</license>
 <license>UNKNOWN_MAPPING(Beerware)</license>
 </spdx_licenses><error>no mapping for "GPL" for pkg "libpam-runtime"</error>
-<error>no mapping for "GPL-3" for pkg "libpam-runtime"</error>
 <error>no mapping for "BSD-tcp_wrappers" for pkg "libpam-runtime"</error>
 <error>no mapping for "Beerware" for pkg "libpam-runtime"</error>
 </pkglicense>
@@ -37286,14 +37281,13 @@ License: Beerware
 <license>BSD-3-Clause OR UNKNOWN_MAPPING(GPL)</license>
 <license>GPL-2.0-only</license>
 <license>GPL-2.0-or-later</license>
-<license>UNKNOWN_MAPPING(GPL-3)</license>
+<license>GPL-3.0-only</license>
 <license>GPL-3.0-or-later WITH Bison exception</license>
 <license>UNKNOWN_MAPPING(BSD-tcp_wrappers)</license>
 <license>LGPL-2.0-or-later</license>
 <license>CC0-1.0</license>
 <license>UNKNOWN_MAPPING(Beerware)</license>
 </spdx_licenses><error>no mapping for "GPL" for pkg "libpam0g"</error>
-<error>no mapping for "GPL-3" for pkg "libpam0g"</error>
 <error>no mapping for "BSD-tcp_wrappers" for pkg "libpam0g"</error>
 <error>no mapping for "Beerware" for pkg "libpam0g"</error>
 </pkglicense>
@@ -37858,10 +37852,9 @@ License: GPL-3
 <license>GPL-2.0-or-later</license>
 <license>UNKNOWN_MAPPING(GFDL-NIV-1.3+)</license>
 <license>UNKNOWN_MAPPING(ISC-no-attribution)</license>
-<license>UNKNOWN_MAPPING(GPL-3)</license>
+<license>GPL-3.0-only</license>
 </spdx_licenses><error>no mapping for "GFDL-NIV-1.3+" for pkg "libreadline8"</error>
 <error>no mapping for "ISC-no-attribution" for pkg "libreadline8"</error>
-<error>no mapping for "GPL-3" for pkg "libreadline8"</error>
 </pkglicense>
 <pkglicense name="libseccomp2"><text>Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 Upstream-Name: libseccomp
@@ -55152,10 +55145,9 @@ License: GPL-3
 <license>GPL-2.0-or-later</license>
 <license>UNKNOWN_MAPPING(GFDL-NIV-1.3+)</license>
 <license>UNKNOWN_MAPPING(ISC-no-attribution)</license>
-<license>UNKNOWN_MAPPING(GPL-3)</license>
+<license>GPL-3.0-only</license>
 </spdx_licenses><error>no mapping for "GFDL-NIV-1.3+" for pkg "readline-common"</error>
 <error>no mapping for "ISC-no-attribution" for pkg "readline-common"</error>
-<error>no mapping for "GPL-3" for pkg "readline-common"</error>
 </pkglicense>
 <pkglicense name="sed"><text>Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 Upstream-Name: GNU sed

-- 
2.45.2



More information about the elbe-devel mailing list