From 07482dc0511350d596fdd25f7645dd6f4f91313b Mon Sep 17 00:00:00 2001 From: Philip McGrath Date: Wed, 19 Oct 2022 01:04:48 -0400 Subject: import/utils: spdx-string->license: Match case-insensitively. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SPDX specifies that license identifiers (unlike the 'AND', 'OR', and 'WITH' operators) are matched case-insensitively. * guix/import/utils.scm (%spdx-license-identifiers): New variable. (spdx-string->license): Search in '%spdx-license-identifiers' using 'string-ci=?'. * tests/import-utils.scm ("spdx-string->license"): New test. Co-authored-by: Ludovic Courtès --- tests/import-utils.scm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/import-utils.scm') diff --git a/tests/import-utils.scm b/tests/import-utils.scm index 026c48bb1e..ee5b16adb8 100644 --- a/tests/import-utils.scm +++ b/tests/import-utils.scm @@ -235,4 +235,9 @@ Differences are hard to spot, e.g. in CLOS vs. GOOPS.")) (equal? (package-upstream-name pkg) "hello-upstream") (hidden-package? pkg)))) +(test-equal "spdx-string->license" + '(license:gpl3+ license:agpl3) + (map spdx-string->license + '("GPL-3.0-oR-LaTeR" "AGPL-3.0"))) + (test-end "import-utils") -- cgit v1.2.3