Package: guix-patches;
Reported by: Philip McGrath <philip <at> philipmcgrath.com>
Date: Wed, 19 Oct 2022 04:56:01 UTC
Severity: normal
Tags: patch
Done: Ludovic Courtès <ludo <at> gnu.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 58621 in the body.
You can then email your comments to 58621 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
View this report as an mbox folder, status mbox, maintainer mbox
philip <at> philipmcgrath.com, guix-patches <at> gnu.org
:bug#58621
; Package guix-patches
.
(Wed, 19 Oct 2022 04:56:01 GMT) Full text and rfc822 format available.Philip McGrath <philip <at> philipmcgrath.com>
:philip <at> philipmcgrath.com, guix-patches <at> gnu.org
.
(Wed, 19 Oct 2022 04:56:02 GMT) Full text and rfc822 format available.Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
From: Philip McGrath <philip <at> philipmcgrath.com> To: guix-patches <at> gnu.org Subject: [PATCH 0/3] import/utils: spdx-string->license: Match case-insensitively and support '+' operator. Date: Wed, 19 Oct 2022 00:55:05 -0400
Hi, This patch series changes 'spdx-string->license' to match SPDX license identifiers case-insensitively (as the specification instructs) and generalizes support for the '+' operator. It also corrects the docstring. My concrete motivation is to more completely translate Racket's "license S-expressions": https://docs.racket-lang.org/pkg/metadata.html#(tech._license._s._expression) For example, this package, which is part of the main Racket distribution, uses the '+' operator: https://pkgs.racket-lang.org/package/scribble-lib (In turn, my impetus for proposing license S-expressions for Racket was to be able to use them in 'guix import racket'.) -Philip Philip McGrath (3): import/utils: spdx-string->license: Fix incorrect docstring. import/utils: spdx-string->license: Match case-insensitively. import/utils: spdx-string->license: Support '+' operator. guix/import/utils.scm | 261 ++++++++++++++++++++++-------------------- 1 file changed, 140 insertions(+), 121 deletions(-) base-commit: 3bb145b6e2a8c84e7739ead9ae76dc4d42bb9850 -- 2.38.0
guix-patches <at> gnu.org
:bug#58621
; Package guix-patches
.
(Wed, 19 Oct 2022 05:06:01 GMT) Full text and rfc822 format available.Message #8 received at 58621 <at> debbugs.gnu.org (full text, mbox):
From: Philip McGrath <philip <at> philipmcgrath.com> To: 58621 <at> debbugs.gnu.org Cc: Philip McGrath <philip <at> philipmcgrath.com> Subject: [PATCH 1/3] import/utils: spdx-string->license: Fix incorrect docstring. Date: Wed, 19 Oct 2022 01:04:47 -0400
The result of 'spdx-string->license' is a symbol, not a license object. * guix/import/utils.scm (spdx-string->license): Fix docstring. (license->symbol): Mention 'license:' prefix in docstring. --- guix/import/utils.scm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/guix/import/utils.scm b/guix/import/utils.scm index 5420037d1d..6afb009a00 100644 --- a/guix/import/utils.scm +++ b/guix/import/utils.scm @@ -12,6 +12,7 @@ ;;; Copyright © 2021 Xinglu Chen <public <at> yoctocell.xyz> ;;; Copyright © 2022 Alice Brenon <alice.brenon <at> ens-lyon.fr> ;;; Copyright © 2022 Kyle Meyer <kyle <at> kyleam.com> +;;; Copyright © 2022 Philip McGrath <philip <at> philipmcgrath.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -131,8 +132,9 @@ (define (guix-hash-url filename) (bytevector->nix-base32-string (file-sha256 filename))) (define (spdx-string->license str) - "Convert STR, a SPDX formatted license identifier, to a license object. - Return #f if STR does not match any known identifiers." + "Convert STR, an SPDX license identifier, to a symbol like 'license:gpl3+ +giving the prefixed name of a license object exported from (guix licenses). +Return #f if STR does not match any known SPDX license identifiers." ;; https://spdx.org/licenses/ ;; The gfl1.0, nmap, repoze ;; licenses doesn't have SPDX identifiers @@ -257,8 +259,9 @@ (define (spdx-string->license str) (_ #f))) (define (license->symbol license) - "Convert license to a symbol representing the variable the object is bound -to in the (guix licenses) module, or #f if there is no such known license." + "Convert LICENSE object to a prefixed symbol representing the variable the +object is bound to in the (guix licenses) module, such as 'license:gpl3+, or +#f if there is no such known license." (define licenses (module-map (lambda (sym var) `(,(variable-ref var) . ,sym)) (resolve-interface '(guix licenses) #:prefix 'license:))) -- 2.38.0
guix-patches <at> gnu.org
:bug#58621
; Package guix-patches
.
(Wed, 19 Oct 2022 05:06:02 GMT) Full text and rfc822 format available.Message #11 received at 58621 <at> debbugs.gnu.org (full text, mbox):
From: Philip McGrath <philip <at> philipmcgrath.com> To: 58621 <at> debbugs.gnu.org Cc: Philip McGrath <philip <at> philipmcgrath.com> Subject: [PATCH 2/3] import/utils: spdx-string->license: Match case-insensitively. Date: Wed, 19 Oct 2022 01:04:48 -0400
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=?'. --- guix/import/utils.scm | 250 ++++++++++++++++++++++-------------------- 1 file changed, 130 insertions(+), 120 deletions(-) diff --git a/guix/import/utils.scm b/guix/import/utils.scm index 6afb009a00..9944b606f3 100644 --- a/guix/import/utils.scm +++ b/guix/import/utils.scm @@ -131,132 +131,142 @@ (define (guix-hash-url filename) "Return the hash of FILENAME in nix-base32 format." (bytevector->nix-base32-string (file-sha256 filename))) -(define (spdx-string->license str) - "Convert STR, an SPDX license identifier, to a symbol like 'license:gpl3+ -giving the prefixed name of a license object exported from (guix licenses). -Return #f if STR does not match any known SPDX license identifiers." +(define %spdx-license-identifiers ;; https://spdx.org/licenses/ ;; The gfl1.0, nmap, repoze ;; licenses doesn't have SPDX identifiers ;; ;; Please update guix/licenses.scm when modifying ;; this list to avoid mismatches. - (match str - ;; "GPL-N+" has been deprecated in favour of "GPL-N-or-later". - ;; "GPL-N" has been deprecated in favour of "GPL-N-only" - ;; or "GPL-N-or-later" as appropriate. Likewise for LGPL - ;; and AGPL - ("AGPL-1.0" 'license:agpl1) - ("AGPL-1.0-only" 'license:agpl1) - ("AGPL-3.0" 'license:agpl3) - ("AGPL-3.0-only" 'license:agpl3) - ("AGPL-3.0-or-later" 'license:agpl3+) - ("Apache-1.1" 'license:asl1.1) - ("Apache-2.0" 'license:asl2.0) - ("APSL-2.0" 'license:apsl2) - ("BSL-1.0" 'license:boost1.0) - ("0BSD" 'license:bsd-0) - ("BSD-2-Clause" 'license:bsd-2) - ("BSD-2-Clause-FreeBSD" 'license:bsd-2) ;flagged as deprecated on spdx - ("BSD-3-Clause" 'license:bsd-3) - ("BSD-4-Clause" 'license:bsd-4) - ("CC0-1.0" 'license:cc0) - ("CC-BY-2.0" 'license:cc-by2.0) - ("CC-BY-3.0" 'license:cc-by3.0) - ("CC-BY-4.0" 'license:cc-by4.0) - ("CC-BY-SA-2.0" 'license:cc-by-sa2.0) - ("CC-BY-SA-3.0" 'license:cc-by-sa3.0) - ("CC-BY-SA-4.0" 'license:cc-by-sa4.0) - ("CDDL-1.0" 'license:cddl1.0) - ("CDDL-1.1" 'license:cddl1.1) - ("CECILL-2.1" 'license:cecill) - ("CECILL-B" 'license:cecill-b) - ("CECILL-C" 'license:cecill-c) - ("Artistic-2.0" 'license:artistic2.0) - ("ClArtistic" 'license:clarified-artistic) - ("copyleft-next-0.3.0" 'license:copyleft-next) - ("CPL-1.0" 'license:cpl1.0) - ("EPL-1.0" 'license:epl1.0) - ("EPL-2.0" 'license:epl2.0) - ("EUPL-1.2" 'license:eupl1.2) - ("MIT" 'license:expat) - ("MIT-0" 'license:expat-0) - ("FTL" 'license:freetype) - ("FreeBSD-DOC" 'license:freebsd-doc) - ("Freetype" 'license:freetype) - ("FSFAP" 'license:fsf-free) - ("FSFUL" 'license:fsf-free) - ("GFDL-1.1" 'license:fdl1.1+) - ("GFDL-1.1-or-later" 'license:fdl1.1+) - ("GFDL-1.2" 'license:fdl1.2+) - ("GFDL-1.2-or-later" 'license:fdl1.2+) - ("GFDL-1.3" 'license:fdl1.3+) - ("GFDL-1.3-or-later" 'license:fdl1.3+) - ("Giftware" 'license:giftware) - ("GPL-1.0" 'license:gpl1) - ("GPL-1.0-only" 'license:gpl1) - ("GPL-1.0+" 'license:gpl1+) - ("GPL-1.0-or-later" 'license:gpl1+) - ("GPL-2.0" 'license:gpl2) - ("GPL-2.0-only" 'license:gpl2) - ("GPL-2.0+" 'license:gpl2+) - ("GPL-2.0-or-later" 'license:gpl2+) - ("GPL-3.0" 'license:gpl3) - ("GPL-3.0-only" 'license:gpl3) - ("GPL-3.0+" 'license:gpl3+) - ("GPL-3.0-or-later" 'license:gpl3+) - ("HPND" 'license:hpnd) - ("ISC" 'license:isc) - ("IJG" 'license:ijg) - ("Imlib2" 'license:imlib2) - ("IPA" 'license:ipa) - ("IPL-1.0" 'license:ibmpl1.0) - ("LAL-1.3" 'license:lal1.3) - ("LGPL-2.0" 'license:lgpl2.0) - ("LGPL-2.0-only" 'license:lgpl2.0) - ("LGPL-2.0+" 'license:lgpl2.0+) - ("LGPL-2.0-or-later" 'license:lgpl2.0+) - ("LGPL-2.1" 'license:lgpl2.1) - ("LGPL-2.1-only" 'license:lgpl2.1) - ("LGPL-2.1+" 'license:lgpl2.1+) - ("LGPL-2.1-or-later" 'license:lgpl2.1+) - ("LGPL-3.0" 'license:lgpl3) - ("LGPL-3.0-only" 'license:lgpl3) - ("LGPL-3.0+" 'license:lgpl3+) - ("LGPL-3.0-or-later" 'license:lgpl3+) - ("LPPL-1.0" 'license:lppl) - ("LPPL-1.1" 'license:lppl) - ("LPPL-1.2" 'license:lppl1.2) - ("LPPL-1.3a" 'license:lppl1.3a) - ("LPPL-1.3c" 'license:lppl1.3c) - ("MirOS" 'license:miros) - ("MPL-1.0" 'license:mpl1.0) - ("MPL-1.1" 'license:mpl1.1) - ("MPL-2.0" 'license:mpl2.0) - ("MS-PL" 'license:ms-pl) - ("NCSA" 'license:ncsa) - ("OGL-UK-1.0" 'license:ogl-psi1.0) - ("OpenSSL" 'license:openssl) - ("OLDAP-2.8" 'license:openldap2.8) - ("OPL-1.0" 'license:opl1.0+) - ("CUA-OPL-1.0" 'license:cua-opl1.0) - ("PSF-2.0" 'license:psfl) - ("OSL-2.1" 'license:osl2.1) - ("QPL-1.0" 'license:qpl) - ("Ruby" 'license:ruby) - ("SGI-B-2.0" 'license:sgifreeb2.0) - ("OFL-1.1" 'license:silofl1.1) - ("Sleepycat" 'license:sleepycat) - ("TCL" 'license:tcl/tk) - ("Unlicense" 'license:unlicense) - ("Vim" 'license:vim) - ("W3C" 'license:w3c) - ("WTFPL" 'license:wtfpl2) - ("wxWindow" 'license:wxwindows3.1+) ;flagged as deprecated on spdx - ("X11" 'license:x11) - ("ZPL-2.1" 'license:zpl2.1) - ("Zlib" 'license:zlib) - (_ #f))) + ;; + ;; "GPL-N+" has been deprecated in favour of "GPL-N-or-later". + ;; "GPL-N" has been deprecated in favour of "GPL-N-only" + ;; or "GPL-N-or-later" as appropriate. Likewise for LGPL + ;; and AGPL. + '(("AGPL-1.0" . license:agpl1) + ("AGPL-1.0-only" . license:agpl1) + ("AGPL-3.0" . license:agpl3) + ("AGPL-3.0-only" . license:agpl3) + ("AGPL-3.0-or-later" . license:agpl3+) + ("Apache-1.1" . license:asl1.1) + ("Apache-2.0" . license:asl2.0) + ("APSL-2.0" . license:apsl2) + ("BSL-1.0" . license:boost1.0) + ("0BSD" . license:bsd-0) + ("BSD-2-Clause" . license:bsd-2) + ("BSD-2-Clause-FreeBSD" . license:bsd-2) ;flagged as deprecated on spdx + ("BSD-3-Clause" . license:bsd-3) + ("BSD-4-Clause" . license:bsd-4) + ("CC0-1.0" . license:cc0) + ("CC-BY-2.0" . license:cc-by2.0) + ("CC-BY-3.0" . license:cc-by3.0) + ("CC-BY-4.0" . license:cc-by4.0) + ("CC-BY-SA-2.0" . license:cc-by-sa2.0) + ("CC-BY-SA-3.0" . license:cc-by-sa3.0) + ("CC-BY-SA-4.0" . license:cc-by-sa4.0) + ("CDDL-1.0" . license:cddl1.0) + ("CDDL-1.1" . license:cddl1.1) + ("CECILL-2.1" . license:cecill) + ("CECILL-B" . license:cecill-b) + ("CECILL-C" . license:cecill-c) + ("Artistic-2.0" . license:artistic2.0) + ("ClArtistic" . license:clarified-artistic) + ("copyleft-next-0.3.0" . license:copyleft-next) + ("CPL-1.0" . license:cpl1.0) + ("EPL-1.0" . license:epl1.0) + ("EPL-2.0" . license:epl2.0) + ("EUPL-1.2" . license:eupl1.2) + ("MIT" . license:expat) + ("MIT-0" . license:expat-0) + ("FTL" . license:freetype) + ("FreeBSD-DOC" . license:freebsd-doc) + ("Freetype" . license:freetype) + ("FSFAP" . license:fsf-free) + ("FSFUL" . license:fsf-free) + ("GFDL-1.1" . license:fdl1.1+) + ("GFDL-1.1-or-later" . license:fdl1.1+) + ("GFDL-1.2" . license:fdl1.2+) + ("GFDL-1.2-or-later" . license:fdl1.2+) + ("GFDL-1.3" . license:fdl1.3+) + ("GFDL-1.3-or-later" . license:fdl1.3+) + ("Giftware" . license:giftware) + ("GPL-1.0" . license:gpl1) + ("GPL-1.0-only" . license:gpl1) + ("GPL-1.0+" . license:gpl1+) + ("GPL-1.0-or-later" . license:gpl1+) + ("GPL-2.0" . license:gpl2) + ("GPL-2.0-only" . license:gpl2) + ("GPL-2.0+" . license:gpl2+) + ("GPL-2.0-or-later" . license:gpl2+) + ("GPL-3.0" . license:gpl3) + ("GPL-3.0-only" . license:gpl3) + ("GPL-3.0+" . license:gpl3+) + ("GPL-3.0-or-later" . license:gpl3+) + ("HPND" . license:hpnd) + ("ISC" . license:isc) + ("IJG" . license:ijg) + ("Imlib2" . license:imlib2) + ("IPA" . license:ipa) + ("IPL-1.0" . license:ibmpl1.0) + ("LAL-1.3" . license:lal1.3) + ("LGPL-2.0" . license:lgpl2.0) + ("LGPL-2.0-only" . license:lgpl2.0) + ("LGPL-2.0+" . license:lgpl2.0+) + ("LGPL-2.0-or-later" . license:lgpl2.0+) + ("LGPL-2.1" . license:lgpl2.1) + ("LGPL-2.1-only" . license:lgpl2.1) + ("LGPL-2.1+" . license:lgpl2.1+) + ("LGPL-2.1-or-later" . license:lgpl2.1+) + ("LGPL-3.0" . license:lgpl3) + ("LGPL-3.0-only" . license:lgpl3) + ("LGPL-3.0+" . license:lgpl3+) + ("LGPL-3.0-or-later" . license:lgpl3+) + ("LPPL-1.0" . license:lppl) + ("LPPL-1.1" . license:lppl) + ("LPPL-1.2" . license:lppl1.2) + ("LPPL-1.3a" . license:lppl1.3a) + ("LPPL-1.3c" . license:lppl1.3c) + ("MirOS" . license:miros) + ("MPL-1.0" . license:mpl1.0) + ("MPL-1.1" . license:mpl1.1) + ("MPL-2.0" . license:mpl2.0) + ("MS-PL" . license:ms-pl) + ("NCSA" . license:ncsa) + ("OGL-UK-1.0" . license:ogl-psi1.0) + ("OpenSSL" . license:openssl) + ("OLDAP-2.8" . license:openldap2.8) + ("OPL-1.0" . license:opl1.0+) + ("CUA-OPL-1.0" . license:cua-opl1.0) + ("PSF-2.0" . license:psfl) + ("OSL-2.1" . license:osl2.1) + ("QPL-1.0" . license:qpl) + ("Ruby" . license:ruby) + ("SGI-B-2.0" . license:sgifreeb2.0) + ("OFL-1.1" . license:silofl1.1) + ("Sleepycat" . license:sleepycat) + ("TCL" . license:tcl/tk) + ("Unlicense" . license:unlicense) + ("Vim" . license:vim) + ("W3C" . license:w3c) + ("WTFPL" . license:wtfpl2) + ("wxWindow" . license:wxwindows3.1+) ;flagged as deprecated on spdx + ("X11" . license:x11) + ("ZPL-2.1" . license:zpl2.1) + ("Zlib" . license:zlib))) + +(define (spdx-string->license str) + "Convert STR, an SPDX license identifier, to a symbol like 'license:gpl3+ +giving the prefixed name of a license object exported from (guix licenses). +Return #f if STR does not match any known SPDX license identifiers. Per the +SPDX specification, license identifiers are compared case-insensitively." + ;; https://spdx.github.io/spdx-spec/v2.3/SPDX-license-expressions/#d2-case-sensitivity + ;; Operators AND, OR, and WITH are case-sensitive, but identifiers are + ;; case-insensitive for matching, though the canonical case is used in URIs. + (match (assoc str %spdx-license-identifiers string-ci=?) + ((_ . license) + license) + (#f + #f))) (define (license->symbol license) "Convert LICENSE object to a prefixed symbol representing the variable the -- 2.38.0
guix-patches <at> gnu.org
:bug#58621
; Package guix-patches
.
(Wed, 19 Oct 2022 05:06:02 GMT) Full text and rfc822 format available.Message #14 received at 58621 <at> debbugs.gnu.org (full text, mbox):
From: Philip McGrath <philip <at> philipmcgrath.com> To: 58621 <at> debbugs.gnu.org Cc: Philip McGrath <philip <at> philipmcgrath.com> Subject: [PATCH 3/3] import/utils: spdx-string->license: Support '+' operator. Date: Wed, 19 Oct 2022 01:04:49 -0400
Previously, '+' was supported only via special cases for deprecated GNU identifiers like 'GPL-N+'. This commit adds support for other uses of '+', such as 'AFL-2.0+' and 'LPPL-1.0+'. Strictly speaking, '+' is an operator, not part of the SPDX license identifier, but it is useful to handle it here. * guix/import/utils.scm (spdx-string->license): Support '+' operator. --- guix/import/utils.scm | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/guix/import/utils.scm b/guix/import/utils.scm index 9944b606f3..a32fa4857e 100644 --- a/guix/import/utils.scm +++ b/guix/import/utils.scm @@ -139,10 +139,11 @@ (define %spdx-license-identifiers ;; Please update guix/licenses.scm when modifying ;; this list to avoid mismatches. ;; - ;; "GPL-N+" has been deprecated in favour of "GPL-N-or-later". - ;; "GPL-N" has been deprecated in favour of "GPL-N-only" - ;; or "GPL-N-or-later" as appropriate. Likewise for LGPL - ;; and AGPL. + ;; "GPL-N+" has been deprecated in favour of "GPL-N-or-later". "GPL-N" has + ;; been deprecated in favour of "GPL-N-only" or "GPL-N-or-later" as + ;; appropriate. Likewise for LGPL and AGPL. However, we list the + ;; deprecated forms here (with and without the "+" operator) to get better + ;; results from old license expressions. '(("AGPL-1.0" . license:agpl1) ("AGPL-1.0-only" . license:agpl1) ("AGPL-3.0" . license:agpl3) @@ -255,10 +256,11 @@ (define %spdx-license-identifiers ("Zlib" . license:zlib))) (define (spdx-string->license str) - "Convert STR, an SPDX license identifier, to a symbol like 'license:gpl3+ -giving the prefixed name of a license object exported from (guix licenses). -Return #f if STR does not match any known SPDX license identifiers. Per the -SPDX specification, license identifiers are compared case-insensitively." + "Convert STR, an SPDX license identifier (possibly with a postfix + +operator), to a symbol like 'license:gpl3+ giving the prefixed name of a +license object exported from (guix licenses). Return #f if STR does not match +any known SPDX license identifiers. Per the SPDX specification, license +identifiers are compared case-insensitively." ;; https://spdx.github.io/spdx-spec/v2.3/SPDX-license-expressions/#d2-case-sensitivity ;; Operators AND, OR, and WITH are case-sensitive, but identifiers are ;; case-insensitive for matching, though the canonical case is used in URIs. @@ -266,7 +268,11 @@ (define (spdx-string->license str) ((_ . license) license) (#f - #f))) + (and (string-suffix? "+" str) + ;; We try the form with the + to support deprecated identifiers for + ;; GNU licenses (see above). Here, we handle other uses of +. + (spdx-string->license + (substring str 0 (- (string-length str) 1))))))) (define (license->symbol license) "Convert LICENSE object to a prefixed symbol representing the variable the -- 2.38.0
Ludovic Courtès <ludo <at> gnu.org>
:Philip McGrath <philip <at> philipmcgrath.com>
:Message #19 received at 58621-done <at> debbugs.gnu.org (full text, mbox):
From: Ludovic Courtès <ludo <at> gnu.org> To: Philip McGrath <philip <at> philipmcgrath.com> Cc: 58621-done <at> debbugs.gnu.org Subject: Re: bug#58621: [PATCH 0/3] import/utils: spdx-string->license: Match case-insensitively and support '+' operator. Date: Fri, 18 Nov 2022 14:45:26 +0100
Hi, Applied all three patches. I added trivial tests for ‘spdx-string->license’ and changed ‘substring’ to ‘string-drop-right’, which I find clearer. Philip McGrath <philip <at> philipmcgrath.com> skribis: > + (and (string-suffix? "+" str) > + ;; We try the form with the + to support deprecated identifiers for > + ;; GNU licenses (see above). Here, we handle other uses of +. > + (spdx-string->license > + (substring str 0 (- (string-length str) 1))))))) I guess we can remove the “+” forms from the alist now? Thanks, Ludo’.
guix-patches <at> gnu.org
:bug#58621
; Package guix-patches
.
(Fri, 18 Nov 2022 20:23:01 GMT) Full text and rfc822 format available.Message #22 received at 58621-done <at> debbugs.gnu.org (full text, mbox):
From: Philip McGrath <philip <at> philipmcgrath.com> To: Ludovic Courtès <ludo <at> gnu.org> Cc: 58621-done <at> debbugs.gnu.org Subject: Re: bug#58621: [PATCH 0/3] import/utils: spdx-string->license: Match case-insensitively and support '+' operator. Date: Fri, 18 Nov 2022 15:21:52 -0500
[Message part 1 (text/plain, inline)]
Hi, On Friday, November 18, 2022 8:45:26 AM EST Ludovic Courtès wrote: > Hi, > > Applied all three patches. I added trivial tests for > ‘spdx-string->license’ and changed ‘substring’ to ‘string-drop-right’, > which I find clearer. > Thanks! > Philip McGrath <philip <at> philipmcgrath.com> skribis: > > + (and (string-suffix? "+" str) > > + ;; We try the form with the + to support deprecated identifiers > > for + ;; GNU licenses (see above). Here, we handle other uses > > of +. + (spdx-string->license > > + (substring str 0 (- (string-length str) 1))))))) > > I guess we can remove the “+” forms from the alist now? > I think we still want the "+" forms in the alist so that we continue convert "GPL-2.0+" as though it were "GPL-2.0-or-later", not "GPL-2.0-only". Some upstreams probably wrote "GPL-2.0" out of confusion even though they intended to allow "any later version" (and maybe even said so in prose), which is why the "+" operator was deprecated for GNU licenses. If upstream wrote "GPL-2.0+", though, that does communicate "or, at your option, any later version"; since that's the more compatible case, it seemed useful to retain that information when we have it. Ideally, upstream projects should move away from the deprecated identifiers (the Racket tooling I've written will complain), but they still seem to come up often enough in the wild to be worth handling as special cases. -Philip
[signature.asc (application/pgp-signature, inline)]
guix-patches <at> gnu.org
:bug#58621
; Package guix-patches
.
(Sun, 20 Nov 2022 10:50:02 GMT) Full text and rfc822 format available.Message #25 received at 58621-done <at> debbugs.gnu.org (full text, mbox):
From: Ludovic Courtès <ludo <at> gnu.org> To: Philip McGrath <philip <at> philipmcgrath.com> Cc: 58621-done <at> debbugs.gnu.org Subject: Re: bug#58621: [PATCH 0/3] import/utils: spdx-string->license: Match case-insensitively and support '+' operator. Date: Sun, 20 Nov 2022 11:49:12 +0100
Hi, Philip McGrath <philip <at> philipmcgrath.com> skribis: > On Friday, November 18, 2022 8:45:26 AM EST Ludovic Courtès wrote: [...] >> Philip McGrath <philip <at> philipmcgrath.com> skribis: >> > + (and (string-suffix? "+" str) >> > + ;; We try the form with the + to support deprecated identifiers >> > for + ;; GNU licenses (see above). Here, we handle other uses >> > of +. + (spdx-string->license >> > + (substring str 0 (- (string-length str) 1))))))) >> >> I guess we can remove the “+” forms from the alist now? >> > > I think we still want the "+" forms in the alist so that we continue convert > "GPL-2.0+" as though it were "GPL-2.0-or-later", not "GPL-2.0-only". Oh right. Then I wonder why the code above (with ‘substring’) doesn’t replace “+” with “-or-later”? Ludo’.
Debbugs Internal Request <help-debbugs <at> gnu.org>
to internal_control <at> debbugs.gnu.org
.
(Sun, 18 Dec 2022 12:24:06 GMT) Full text and rfc822 format available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.