From unknown Thu Aug 21 14:54:13 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#58621 <58621@debbugs.gnu.org> To: bug#58621 <58621@debbugs.gnu.org> Subject: Status: [PATCH 0/3] import/utils: spdx-string->license: Match case-insensitively and support '+' operator. Reply-To: bug#58621 <58621@debbugs.gnu.org> Date: Thu, 21 Aug 2025 21:54:13 +0000 retitle 58621 [PATCH 0/3] import/utils: spdx-string->license: Match case-in= sensitively and support '+' operator. reassign 58621 guix-patches submitter 58621 Philip McGrath severity 58621 normal tag 58621 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 19 00:55:17 2022 Received: (at submit) by debbugs.gnu.org; 19 Oct 2022 04:55:17 +0000 Received: from localhost ([127.0.0.1]:55453 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ol16q-0003GO-S7 for submit@debbugs.gnu.org; Wed, 19 Oct 2022 00:55:17 -0400 Received: from lists.gnu.org ([209.51.188.17]:57188) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ol16o-0003GE-DY for submit@debbugs.gnu.org; Wed, 19 Oct 2022 00:55:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59394) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ol16m-0004YR-TH for guix-patches@gnu.org; Wed, 19 Oct 2022 00:55:13 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:39797) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ol16k-00037K-Qn for guix-patches@gnu.org; Wed, 19 Oct 2022 00:55:12 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 780B35C0190 for ; Wed, 19 Oct 2022 00:55:08 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Wed, 19 Oct 2022 00:55:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:content-transfer-encoding:date:date:from :from:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to; s=fm3; t=1666155308; x=1666241708; bh=ZJ /jqUJetzuo4obAwDOlJ/BxuBfJBgWhOQmuwYssOjY=; b=V0Vn6iuGArFFLk85yZ S60dOhIoIxzYA/jBZIREA5TXlxTQF6YyplOGWZQi4MPzbchvV08FPzeDBFTSm6lS wCfe/S81NbUei1n1PPVmyYwNAtDnT2RF+lTUs/cGHPrAeH/5Ts+oSR18Cb6veM/k Es3WK9A/aTTCQRMdQD+C4qtfmAMaEfGg91C9NaNCjeL2eSpni0S6iD75KDdvH9Id 6p3nnI1isGGyHt+RLM78fN5K1Z80PJERLDrw+DKycsoZL5EXqWJNLBrdTQqb5RXe Zwl5ggHixo/jhDGSHPVzfOXrgCY69Oa3Zh7AtuLyz1X9DH1qhl4zH1htvzHsgves 38Qw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1666155308; x=1666241708; bh=ZJ/jqUJetzuo4obAwDOlJ/BxuBfJBgWhOQm uwYssOjY=; b=fNwJu5pCLGAIXMlDAEM5Slvb4IWD1vBnwWojtDcJKJhIF+myrSL yPLw2bezQdNHDEuVPl/8WkMPbAKGbvqlE45Gm7YCua9SqdX3qsxOlehtmnJdtOCO 4U90sAl9LUTi5LgBsUUGvv0ocy/fbOA0ljuPlJnOCkQEFX/9Ky+tZ6+IRspugHfW HruKtE54hYl7k9NY4m1BOEa4wIz53PzCx4c200uzYD7tnhpOGoOPzG0ZN9zBZtFB 11JIGfiwxgQszX3vsN2eEVW5UvaPf3EQoA5enYrazkWO87wI7hnpDe01JpJwa2yS +1547AUu/frkkOJ8km98oSG4z40GYyc8U1Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeelfedgkeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgggfestdekredtre dttdenucfhrhhomheprfhhihhlihhpucfotgfirhgrthhhuceophhhihhlihhpsehphhhi lhhiphhmtghgrhgrthhhrdgtohhmqeenucggtffrrghtthgvrhhnpedtledthfdugfehke efkeeifeetgfdvgeefgfevffettdekgfevteduffeguddvteenucffohhmrghinheprhgr tghkvghtqdhlrghnghdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomh X-ME-Proxy: Feedback-ID: i2b1146f3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 19 Oct 2022 00:55:08 -0400 (EDT) From: Philip McGrath To: guix-patches@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 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Debbugs-Cc: Philip McGrath Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=66.111.4.25; envelope-from=philip@philipmcgrath.com; helo=out1-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) 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 From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 19 01:05:14 2022 Received: (at 58621) by debbugs.gnu.org; 19 Oct 2022 05:05:14 +0000 Received: from localhost ([127.0.0.1]:55483 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ol1GT-0003XB-KI for submit@debbugs.gnu.org; Wed, 19 Oct 2022 01:05:14 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:44889) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ol1GQ-0003Wt-Hw for 58621@debbugs.gnu.org; Wed, 19 Oct 2022 01:05:12 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 459E05C0186; Wed, 19 Oct 2022 01:05:05 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 19 Oct 2022 01:05:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm3; t=1666155905; x=1666242305; bh=Zc8xR/Rfe3 HBBiAq5450A9BOh0IUsTjn6mamBVeZE1U=; b=PrseJc4PlTHE6N8FFn4LAvc9gK dRDV0JWK4CXTXdKSEx4dYjSBsmQdkBaA03yBPquCZM37XQh7sMeJCpB7xVdPq5HM cA3pi1MG/Yz486H0K6KQh6HzuGm6osEQsrjjpEf7ExjRlqfR2QlrRy/5CFbrqG/f 8NpbZuhlCnM2YB9FHS0caWOFKTTPADDPSmxI+DZbtf8UutUhQtPGe0tzXfpYhEwN L0j5K6rSJ5hZL8+dKLcqihAzRt4Az6so6l6nO3jpx8uumgp1nHrwcnDKMrOLdPL1 Z+RBOxLKIQamy44E7PO6XHNFZRjB9FvC8tQd8R7e+hz8Zvaom1MHaD5PJtHA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1666155905; x= 1666242305; bh=Zc8xR/Rfe3HBBiAq5450A9BOh0IUsTjn6mamBVeZE1U=; b=K 7eLGOOjHhwpm9F1FhMbSlEgY5o65lJCIxuuSZZkLlEEyTuynribllqZrewWqjLbr d0IDEmpBRZPhWhdkyII9kbT1pO/OMADVWSy1dXjCWRLZg/TLC64gOJ6fnZKjPO8U rhwuO+PZCnh/9/HbcOtCuBffZlC3KiVhrj3EB3ajqN2jTWxyt78P2rPVxyEGJZOZ rM9WUHmQJ2K8Wg+WschSAvVHf8ie2+ugQRpZ/R9C2y9g+JG5rdtxO5sq239N/5sA 6yABuYhR2viomvEGo+SVNo67FRD2nyUdIOPd4MXXkfdclTabDY/cBX2WbUjrBeQk 5clhlceuivilFGodfiFsQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeelfedgleduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdludejmdenucfjughrpefhvf evufffkffojghfgggtgfesthekredtredtjeenucfhrhhomheprfhhihhlihhpucfotgfi rhgrthhhuceophhhihhlihhpsehphhhilhhiphhmtghgrhgrthhhrdgtohhmqeenucggtf frrghtthgvrhhnpeeuveekgeelteeuleetvedvudelhfegueefhfdvfeffveeludfhtddv ieelgeffteenucffohhmrghinhepshhpugigrdhorhhgnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepphhhihhlihhpsehphhhilhhiphhmtghg rhgrthhhrdgtohhm X-ME-Proxy: Feedback-ID: i2b1146f3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 19 Oct 2022 01:05:04 -0400 (EDT) From: Philip McGrath To: 58621@debbugs.gnu.org Subject: [PATCH 1/3] import/utils: spdx-string->license: Fix incorrect docstring. Date: Wed, 19 Oct 2022 01:04:47 -0400 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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 [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [66.111.4.25 listed in wl.mailspike.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [66.111.4.25 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-Debbugs-Envelope-To: 58621 Cc: Philip McGrath X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) 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 ;;; Copyright © 2022 Alice Brenon ;;; Copyright © 2022 Kyle Meyer +;;; Copyright © 2022 Philip McGrath ;;; ;;; 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 From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 19 01:05:18 2022 Received: (at 58621) by debbugs.gnu.org; 19 Oct 2022 05:05:19 +0000 Received: from localhost ([127.0.0.1]:55491 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ol1GY-0003XZ-3p for submit@debbugs.gnu.org; Wed, 19 Oct 2022 01:05:18 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:55411) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ol1GU-0003Wy-3O for 58621@debbugs.gnu.org; Wed, 19 Oct 2022 01:05:15 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 112E45C018D; Wed, 19 Oct 2022 01:05:09 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Wed, 19 Oct 2022 01:05:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:cc:content-transfer-encoding:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1666155909; x=1666242309; bh=2KoWng5h3GnQj1kAz2f4QMu1h1ksF7xyzdt 423gGh4w=; b=OWinxBjdOhfRsI8CTdlO1WAvjaIL2n1FnY/B86F3YW6GDHcDVfV jGZR9DWRnSXi62XqZhi+W2VSQfECDSap8AE7madqZbbFgiGD6l6IwyVVDuBEVc1a u+kSQL0gw/3zGH1GoGiTSu7zM4nJqHsnqcacp1en7c3/YU0uAcSl3yyVK1YyXmv9 uJI8DBNqqRbMNnbK0XZufVsf8giJpV+7QGvJxRoDOvNpLsL6Qy6EO5enR4FpleUy eok3F5P7SVNYo50/Yts5FtoRKDzsK4YwOjvPJYas6xVnoGkKpMd9zOsAo9IuGITJ iDhSlqK1J2GM7qaetpqszP4zvuwT2B617QA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1666155909; x=1666242309; bh=2KoWng5h3GnQj 1kAz2f4QMu1h1ksF7xyzdt423gGh4w=; b=bQgb9bFyNfxv8YLfel8szsQ9Mx1SF xHC91NxF+1zSMyLey40Zvzl8sI3hU8i9G9snJl71PgGWBi0BaHC0uLfEsk2vymG6 TL+x9p6aNmpyFrG19a7K/luHFXZC/MYaSKKiYZO5Zs7e15DXakMtpDpn4SQp1e1c c8BAiywMLH3J6wVNpPwy1cp8fvKck8T1B1ILygkC/5XlLDruTJ7ukS4tQiPE5NLw 5m73uJDIlKhPUFIbF7d6dug2gP44BxZgGCa5bQk2n6lnWoze2YUiCXe53UPvHlLc uxdDwXnCkQXKqYg9QRS0+pdZIsjy2Fo37zeMTG1v/6N8PUhIZJPSGRpcw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeelfedgledtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgoufhushhpvggtthffohhmrghinhculdegledmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomheprfhhihhl ihhpucfotgfirhgrthhhuceophhhihhlihhpsehphhhilhhiphhmtghgrhgrthhhrdgtoh hmqeenucggtffrrghtthgvrhhnpedtkeelvedvtedvjeduvdejkeejvdethfelleejffdu veeigeevffffuedttdelueenucffohhmrghinhepshhpugigrdhorhhgpdhgihhthhhusg drihhonecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhep phhhihhlihhpsehphhhilhhiphhmtghgrhgrthhhrdgtohhm X-ME-Proxy: Feedback-ID: i2b1146f3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 19 Oct 2022 01:05:08 -0400 (EDT) From: Philip McGrath To: 58621@debbugs.gnu.org Subject: [PATCH 2/3] import/utils: spdx-string->license: Match case-insensitively. Date: Wed, 19 Oct 2022 01:04:48 -0400 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 58621 Cc: Philip McGrath X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) 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 From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 19 01:05:19 2022 Received: (at 58621) by debbugs.gnu.org; 19 Oct 2022 05:05:19 +0000 Received: from localhost ([127.0.0.1]:55493 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ol1GY-0003Xc-Sk for submit@debbugs.gnu.org; Wed, 19 Oct 2022 01:05:19 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:57565) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ol1GU-0003Wz-Lt for 58621@debbugs.gnu.org; Wed, 19 Oct 2022 01:05:15 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 9E7935C0182; Wed, 19 Oct 2022 01:05:09 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 19 Oct 2022 01:05:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:cc:content-transfer-encoding:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1666155909; x=1666242309; bh=NSlQHlhhE6pwUxXhIwzpwykYucp3Dq4GEdi 0vPQb7Go=; b=eOjw2+uQzhhVaeQ8zsvV+DEhGBWLsfNrlOLLzS2BB3oMPSMUpYD NVx8KsXi3ENwp3u+Yfg9uVtf8tlGM0uJAlK25WJvu/RGrZYLGHHGPKzjmZOijcEK djSUQuasyo4rfVxtan163Agq3OmN4kkC0KiFpSS85WFFSLPIecKqi8x8KJnApGS7 hLsEKFYep2s3zat/rR3j4yqd0OCo/RnrJJBV8bLlnuCRGNjwjFeFe1g4khIY0jxh KJSSwN2mepWaQbeHrJFpGIPy4PcsLzb/nsoFPy27wJMzyuRn0CfSOyRJkKJ0pmwj 4OIKpr7IFRxpeTCoXSKKKtyPyYIki1TGjkg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1666155909; x=1666242309; bh=NSlQHlhhE6pwU xXhIwzpwykYucp3Dq4GEdi0vPQb7Go=; b=dFLHbDTnFhRki1FeR+pPAS+iIGH1m 7FOe3KCCILIAW8EK5yXlzWAP0OV0o5WuorFOrEllmtfG68pKpfwd0ldb3VdX9mf4 360kpXcsBz5ocPhyk6+SrolaXMjzCQiidL3ce6T+Ulv5zUDJF4Rq8uMjqtEMmC2B EahNW92Ws64ixd4PVXRerZCEXTPIxW6vwxv2zxPy410cMlteyGPf7g0zW7DdddUC ijdpZfC/tLYGHf+zU4fdByvbu21Ee+8ZwXoUFvIBDbZc7WmNweT3IlUcRqX224S/ HGrL5/1NaBcAwApiQkgPxApb+FT7Bk1QGbhRyElu0TzbqQQT9FY9740VQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeelfedgledtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgoufhushhpvggtthffohhmrghinhculdegledmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomheprfhhihhl ihhpucfotgfirhgrthhhuceophhhihhlihhpsehphhhilhhiphhmtghgrhgrthhhrdgtoh hmqeenucggtffrrghtthgvrhhnpeeugeetteehjefgkeffvedukeelffeitdefvdeffedu geefgeeiteehjeeludeiteenucffohhmrghinhepghhithhhuhgsrdhiohenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehphhhilhhiphesphhh ihhlihhpmhgtghhrrghthhdrtghomh X-ME-Proxy: Feedback-ID: i2b1146f3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 19 Oct 2022 01:05:09 -0400 (EDT) From: Philip McGrath To: 58621@debbugs.gnu.org Subject: [PATCH 3/3] import/utils: spdx-string->license: Support '+' operator. Date: Wed, 19 Oct 2022 01:04:49 -0400 Message-Id: <13f3bbfbd88f0e9c984fd61a5c936de08d814ce0.1666146461.git.philip@philipmcgrath.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 58621 Cc: Philip McGrath X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) 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 From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 18 08:45:38 2022 Received: (at 58621-done) by debbugs.gnu.org; 18 Nov 2022 13:45:38 +0000 Received: from localhost ([127.0.0.1]:35811 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ow1gX-00066K-Pj for submit@debbugs.gnu.org; Fri, 18 Nov 2022 08:45:38 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56410) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ow1gU-00065r-JQ for 58621-done@debbugs.gnu.org; Fri, 18 Nov 2022 08:45:36 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ow1gP-0003Vu-AW; Fri, 18 Nov 2022 08:45:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=EccoOzUJfUmqbzVs0zL4yv7+UpyL83f240uSifW1UJM=; b=Jhr4Wm7tOFf3u040+HKj fyVS524CGX8S+4GT4aBU3hHOG6VmYvw2ryeP6YYH/iJ7RUAMXg5t/TXkM4GSAwxIWNxkO9JAf9FUI Ktn3kU1gBdLFTGvWnVCWzNOIA5U5lQEm9wVFzrUeLW4LfcbEqhm6r75HDtyYQsPgL18jZBW9PpgRz nNSqmT3e7dKrGbLYcKs7WA8R/Mjb9YT4CGkwpBjjZMj2qx8AnUl74Vor8CZdUnd030VbxgZ3IZ36F qAIdrPCZTBnmCggv6Qu9VMWbYVMXYjOSobbpcMXoS1jibN4Vh0YlvrQInohGZfLR7pC/xNwqUU0Bg l8yJGASor44Lyg==; Received: from [193.50.110.147] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ow1gO-00046M-Qi; Fri, 18 Nov 2022 08:45:29 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Philip McGrath Subject: Re: bug#58621: [PATCH 0/3] import/utils: spdx-string->license: Match case-insensitively and support '+' operator. References: <13f3bbfbd88f0e9c984fd61a5c936de08d814ce0.1666146461.git.philip@philipmcgrath.com> Date: Fri, 18 Nov 2022 14:45:26 +0100 In-Reply-To: <13f3bbfbd88f0e9c984fd61a5c936de08d814ce0.1666146461.git.philip@philipmcgrath.com> (Philip McGrath's message of "Wed, 19 Oct 2022 01:04:49 -0400") Message-ID: <877czscr61.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58621-done Cc: 58621-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Applied all three patches. I added trivial tests for =E2=80=98spdx-string->license=E2=80=99 and changed =E2=80=98substring=E2=80= =99 to =E2=80=98string-drop-right=E2=80=99, which I find clearer. Philip McGrath skribis: > + (and (string-suffix? "+" str) > + ;; We try the form with the + to support deprecated identifier= s 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 =E2=80=9C+=E2=80=9D forms from the alist now? Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 18 15:22:12 2022 Received: (at 58621-done) by debbugs.gnu.org; 18 Nov 2022 20:22:12 +0000 Received: from localhost ([127.0.0.1]:38405 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ow7sK-0006hJ-GM for submit@debbugs.gnu.org; Fri, 18 Nov 2022 15:22:12 -0500 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:39631) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ow7sJ-0006h6-4m for 58621-done@debbugs.gnu.org; Fri, 18 Nov 2022 15:22:11 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 804973200AF3; Fri, 18 Nov 2022 15:22:04 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Fri, 18 Nov 2022 15:22:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1668802924; x= 1668889324; bh=GoQLLjtiToqSsHZSkX/34716IWOFGX3s0W+uR5Fee2w=; b=V Ys9EuRIMyZdR17KwWbEVl3HVYU6ExXY4x/1H5inE3kTrcWfEoshCFwGAdvBYXdHG abo31KKT1ENv1v3TWPUcMlYglDy21rzudbNNmkCdqFbu8jPcyOOMVgcntLY7TP2w VomGNbRIoKIp5ZDFo5vB3Cge4tN+9ON4bfXDakoaxUaiMjx0m133kGB7J5RGcBx1 nOga1eMQuN6vYuOhMJWpJcCoad8ZZrQo5eO6Bg6HtL7b5B7l+XloBjmgBd5N7MdM RT1c5sdbAEH0tF2N0yzc+EVAhEIVz8Mx7T8m4WMGm8dfgOOOU6abX34NLeTGct4J ZE2+Zeqn4faSEbGyKIXew== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1668802924; x=1668889324; bh=GoQLLjtiToqSsHZSkX/34716IWOF GX3s0W+uR5Fee2w=; b=jgoS30zIcHjh02+DsZrdIbCrXWhMQ0ccMdPOHD89cXHd 4YggHrXxRaAnaUcdRlUrZ+NXbNS2xXCYFdMA93mYY7cCuytOn9tOueeDG+BoxYYE E0A++M+pjHGHrLwtrZwuES6Pqwazx/0q3Ea7AnizoZLRTsglOudiGDJvP7IrkOj0 BZLRumsRXGYGxhD6mzMlW8HhcM4csC9aYluAZV+Qrf96Qfl1TJSKMzFXdACQ3yeN DBUwJW4fJUoZXXXKvDe3S8/LNCNlltMoLqWjItjcNm6b2U80fDr5Bbd/Z2RdWq33 gQnoFzdU4ciTEkVOzZlfDJESPLRWQtXzV8wujqQo4Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrhedtgddufeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkjghfgggtsehgtderredttdejnecuhfhrohhmpefrhhhilhhi phcuofgtifhrrghthhcuoehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomh eqnecuggftrfgrthhtvghrnhepgfffudekheeguefgveehgfegudegvddvhefhfedvheel heeguedugfdtleelgfelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhepphhhihhlihhpsehphhhilhhiphhmtghgrhgrthhhrdgtohhm X-ME-Proxy: Feedback-ID: i2b1146f3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 18 Nov 2022 15:22:03 -0500 (EST) From: Philip McGrath To: Ludovic =?ISO-8859-1?Q?Court=E8s?= 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-ID: <7474321.EvYhyI6sBW@bastet> In-Reply-To: <877czscr61.fsf_-_@gnu.org> References: <13f3bbfbd88f0e9c984fd61a5c936de08d814ce0.1666146461.git.philip@philipmcgrath.com> <877czscr61.fsf_-_@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3724536.kQq0lBPeGt"; micalg="pgp-sha512"; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 58621-done Cc: 58621-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --nextPart3724536.kQq0lBPeGt Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8"; protected-headers="v1" From: Philip McGrath To: Ludovic =?ISO-8859-1?Q?Court=E8s?= Cc: 58621-done@debbugs.gnu.org Date: Fri, 18 Nov 2022 15:21:52 -0500 Message-ID: <7474321.EvYhyI6sBW@bastet> In-Reply-To: <877czscr61.fsf_-_@gnu.org> MIME-Version: 1.0 Hi, On Friday, November 18, 2022 8:45:26 AM EST Ludovic Court=C3=A8s wrote: > Hi, >=20 > Applied all three patches. I added trivial tests for > =E2=80=98spdx-string->license=E2=80=99 and changed =E2=80=98substring=E2= =80=99 to =E2=80=98string-drop-right=E2=80=99, > which I find clearer. >=20 Thanks! > Philip McGrath skribis: > > + (and (string-suffix? "+" str) > > + ;; We try the form with the + to support deprecated identifi= ers > > for + ;; GNU licenses (see above). Here, we handle other uses > > of +. + (spdx-string->license > > + (substring str 0 (- (string-length str) 1))))))) >=20 > I guess we can remove the =E2=80=9C+=E2=80=9D forms from the alist now? >=20 I think we still want the "+" forms in the alist so that we continue conver= t=20 "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=20 intended to allow "any later version" (and maybe even said so in prose), wh= ich=20 is why the "+" operator was deprecated for GNU licenses. If upstream wrote "GPL-2.0+", though, that does communicate "or, at your=20 option, any later version"; since that's the more compatible case, it seeme= d=20 useful to retain that information when we have it. Ideally, upstream projects should move away from the deprecated identifiers= =20 (the Racket tooling I've written will complain), but they still seem to com= e=20 up often enough in the wild to be worth handling as special cases. =2DPhilip --nextPart3724536.kQq0lBPeGt Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE9GWrrNY3rqwUFVXPygNjjfo/HHoFAmN36WAACgkQygNjjfo/ HHralQ//SPaXnii4vGL9ScS+8w0gj90NA4WFy+YkZvSxpEis5SldYRiUvy7M+lTa i7UFtTu0Q4KPdPgIjYaPW2KIxI/irBLp2mJNAxPlTVEo4KEYda92+Q4Q8kNeLxfL zFKUDB8JGt3lZXxQ+1vVMm+seqh2HydRxc3E97+IlDsPNe+78Q0KLK07YjsEQOrM tYvqGzHozsmrKwv3OCKJlvyZYQeIO3PiGX9PpeQJzrbrozFAk5TGCqaUU8wrReC3 N3fpeNthklP8QPNZsM8HQhWUpzrwoAtbpUBBUCaGBBI2ykHCQBW8dtpoPnGg8Lng 08MklUkQilPyttYoZk+BEPMX44v4z+d1jPZTLLBYt8lCB019ojnIGzRicqZTSu22 KerSwJBbzDuP3PjOrGoIpmUSP7Bj+w89XV9Cery+DYmODycjCoJYiQdQUXzTz/Ow lAIGQJxeNsxrCEDRHOu1kqe86UXqJnr1atjk6C0Kg+FAIB8zApYfvOtE1OsmwKPU D7SHD2ZaxXCY0QKYNrqiPznOOTozRqWXBE5X0UBzp7ax4lpz8Gqj8YbMK/e53jmN t55DtYvPFFWPEtmw9fb8hXxqkafWAB14bfBqak5PmbAwil4yAXOG34BxtJv4WbrZ 5Sn+O2kwWqyHL6cwMdNv0K24NAzv5cs5fBZksgfFbF0IH2p74NM= =MXwp -----END PGP SIGNATURE----- --nextPart3724536.kQq0lBPeGt-- From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 20 05:49:22 2022 Received: (at 58621-done) by debbugs.gnu.org; 20 Nov 2022 10:49:22 +0000 Received: from localhost ([127.0.0.1]:42462 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owht3-0006Sj-Nu for submit@debbugs.gnu.org; Sun, 20 Nov 2022 05:49:22 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59766) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owht2-0006SY-9K for 58621-done@debbugs.gnu.org; Sun, 20 Nov 2022 05:49:20 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1owhsx-0003MC-0T; Sun, 20 Nov 2022 05:49:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=X2BhobfMFXpv5F6pSaKYEP8TCwcA1+k25RuYnMBpQA0=; b=GfmmskwDm4e3hPXuvHSP Z0FAai1+bTOJQvt2haOk4izRF8pB0jjgG0IDIUePnIC90dCrjk2o/3FYcIprc7OPoT+SSm4OTA8sq fuQwsgwcksk2rC9WCto4Ad4oNINIZoQGlJLv3VhVDAEI9U8t47wn5Ga0RpEkofVhrz9p3OGdwl9Sq RCAcobgU7pH3s1HNfmFaXb05KQVK3Fpwwnwk8pWv5gQKUTwxaqjkrOuu2fVhuds+mIroLkzUMrfZ3 6NztMZsZDrkCAFB7QNh1dhGMmy17yfN6QoKWB5stUh/DKAJJgpn18yR+khhfH+xI33vK3t7vwOaLk YSwTdYbE0RQeIw==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1owhsw-0004qF-Jx; Sun, 20 Nov 2022 05:49:14 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Philip McGrath Subject: Re: bug#58621: [PATCH 0/3] import/utils: spdx-string->license: Match case-insensitively and support '+' operator. References: <13f3bbfbd88f0e9c984fd61a5c936de08d814ce0.1666146461.git.philip@philipmcgrath.com> <877czscr61.fsf_-_@gnu.org> <7474321.EvYhyI6sBW@bastet> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: =?utf-8?Q?D=C3=A9cadi?= 30 Brumaire an 231 de la =?utf-8?Q?R=C3=A9volution=2C?= jour du Rouleau X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sun, 20 Nov 2022 11:49:12 +0100 In-Reply-To: <7474321.EvYhyI6sBW@bastet> (Philip McGrath's message of "Fri, 18 Nov 2022 15:21:52 -0500") Message-ID: <87leo57vfb.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58621-done Cc: 58621-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Philip McGrath skribis: > On Friday, November 18, 2022 8:45:26 AM EST Ludovic Court=C3=A8s wrote: [...] >> Philip McGrath skribis: >> > + (and (string-suffix? "+" str) >> > + ;; We try the form with the + to support deprecated identif= iers >> > for + ;; GNU licenses (see above). Here, we handle other uses >> > of +. + (spdx-string->license >> > + (substring str 0 (- (string-length str) 1))))))) >>=20 >> I guess we can remove the =E2=80=9C+=E2=80=9D forms from the alist now? >>=20 > > I think we still want the "+" forms in the alist so that we continue conv= ert=20 > "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 =E2=80=98substring=E2=80= =99) doesn=E2=80=99t replace =E2=80=9C+=E2=80=9D with =E2=80=9C-or-later=E2=80=9D? Ludo=E2=80=99. From unknown Thu Aug 21 14:54:13 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 18 Dec 2022 12:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator