From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id wI1EHWmzEmU2GQAAG6o9tA:P1 (envelope-from ) for ; Tue, 26 Sep 2023 12:33:13 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id wI1EHWmzEmU2GQAAG6o9tA (envelope-from ) for ; Tue, 26 Sep 2023 12:33:13 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 390B23FA26 for ; Tue, 26 Sep 2023 12:33:13 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1695724393; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=taJCVrVy2mnktZg7k3saIqSw2y3o2HJeEDALeiKnxuI=; b=kVcOFu/fSZS7sDktCBbRGI21lsqIyj7QIlREUEZyuXi/D3t0xzwdpbNrN9hV8+JIDTSwam T1oMrwHwi7rkkCr1IcpZ/2WGHzuYh2HEwCdCw+U9vQiLKLRP2mNRImqKJvTF7m+Yib2LtL x4If6nqQp91tdiKVl8llGimw+w004jJud9ib7kdEzlBzhV7nIs1q3XdkpvgLGw/15IzSMR HwM4RZg/xgxSLvPo6TzGAOySY+ndhBFOcwLbgGyssEfQMrmed7yl1DEYps4EF1BQnwpP8K Ey/+ixN98aY6tjC2929KQ5/2ChUi/RoPHhXJEFhMbvi6uLGUipHaImpyn6WbkA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1695724393; a=rsa-sha256; cv=none; b=HBGc2PWzrSRycuKQNKYzuvUG3LEWgdmlz5QWiIsnp6QAfk3cSScQub9gdLswPgLDCxKz/O g379O0s/TmyqAt92lURfJO6+IvQJVVtLkaPiatuPWmd6BR+RCYYJ3/tLnG76URlpD8MaBe cKEZbYO3BaNvVPIpJOe72Nmy/DrrDc7KGr0e4FiuveiKydPoKTL82ZU3qWpxpNihZgi0UT 3nsx47sr1x++H5q1P5aOCBgvI++SHdyJOEPL0E74QdLbOqTKR3YElxVPNoEY/KsJsPYso+ nOghXB39+m/eC9E+z8b85l7Eo9VM16+vHqKB8CszAeegHWbAgYenj20WiLN8Vw== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ql5N7-0002K1-3M; Tue, 26 Sep 2023 06:32:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ql5N5-0002JR-Ov for guix-patches@gnu.org; Tue, 26 Sep 2023 06:32:51 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ql5N5-0000oT-GK for guix-patches@gnu.org; Tue, 26 Sep 2023 06:32:51 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ql5NI-00007Z-Cx for guix-patches@gnu.org; Tue, 26 Sep 2023 06:33:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#42338] [PATCH v3 6/7] guix: import: composer: More robust string->license. Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 26 Sep 2023 10:33:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42338 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42338@debbugs.gnu.org Cc: ngraves@ngraves.fr Received: via spool by 42338-submit@debbugs.gnu.org id=B42338.1695724348372 (code B ref 42338); Tue, 26 Sep 2023 10:33:04 +0000 Received: (at 42338) by debbugs.gnu.org; 26 Sep 2023 10:32:28 +0000 Received: from localhost ([127.0.0.1]:47359 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ql5Mi-00005j-Fe for submit@debbugs.gnu.org; Tue, 26 Sep 2023 06:32:28 -0400 Received: from 9.mo581.mail-out.ovh.net ([46.105.60.248]:39603) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ql5Mb-00004s-W3 for 42338@debbugs.gnu.org; Tue, 26 Sep 2023 06:32:22 -0400 Received: from director7.ghost.mail-out.ovh.net (unknown [10.109.146.1]) by mo581.mail-out.ovh.net (Postfix) with ESMTP id B3394284AC for <42338@debbugs.gnu.org>; Tue, 26 Sep 2023 10:32:07 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-tbpgm (unknown [10.110.115.108]) by director7.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 41AA01FEF9; Tue, 26 Sep 2023 10:32:07 +0000 (UTC) Received: from ngraves.fr ([37.59.142.110]) by ghost-submission-6684bf9d7b-tbpgm with ESMTPSA id mEMgEyezEmXamwAAkgoTgg (envelope-from ); Tue, 26 Sep 2023 10:32:07 +0000 X-OVh-ClientIp: 81.67.140.142 Date: Tue, 26 Sep 2023 12:31:43 +0200 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: <6abfbb4d4d57642fea6bae5835ff0d365de7e24a.1695724304.git.ngraves@ngraves.fr> References: <6abfbb4d4d57642fea6bae5835ff0d365de7e24a.1695724304.git.ngraves@ngraves.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 12909286858710311650 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvjedrtddtgddtudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecunecujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeelffejteeutefhfeekfffffedvudekjeekgfeludeitdfhkeevhfeivdfhffeggeenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegtddrudegvddpfeejrdehledrudegvddruddutdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepgedvfeefkeesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheekuddpmhhouggvpehsmhhtphhouhht X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches From: Nicolas Graves via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -6.20 X-Migadu-Scanner: mx2.migadu.com X-Migadu-Queue-Id: 390B23FA26 X-Spam-Score: -6.20 X-TUID: TbCL6teZaE/9 * guix/import/composer.scm (string->license): Use spdx-string->license. Fall back to unknown-license!. --- guix/import/composer.scm | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/guix/import/composer.scm b/guix/import/composer.scm index 3acbbecf82..2ce7206ef9 100644 --- a/guix/import/composer.scm +++ b/guix/import/composer.scm @@ -194,10 +194,8 @@ (define (make-php-sexp composer-package) (synopsis "") (description ,(composer-package-description composer-package)) (home-page ,(composer-package-homepage composer-package)) - (license ,(match (composer-package-license composer-package) - (() #f) - ((license) license) - (_ license))))))))) + (license ,(or (composer-package-license composer-package) + 'unknown-license!)))))))) (define composer->guix-package (memoize @@ -234,14 +232,15 @@ (define (guix-package->composer-name package) (define (string->license str) "Convert the string STR into a license object." - (match str - ("GNU LGPL" 'license:lgpl2.0) - ("GPL" 'license:gpl3) - ((or "BSD" "BSD License" "BSD-3-Clause") 'license:bsd-3) - ((or "MIT" "MIT license" "Expat license") 'license:expat) - ("Public domain" 'license:public-domain) - ((or "Apache License, Version 2.0" "Apache 2.0") 'license:asl2.0) - (_ #f))) + (or (spdx-string->license str) + (match str + ("GNU LGPL" 'license:lgpl2.0) + ("GPL" 'license:gpl3) + ((or "BSD" "BSD License") 'license:bsd-3) + ((or "MIT" "MIT license" "Expat license") 'license:expat) + ("Public domain" 'license:public-domain) + ((or "Apache License, Version 2.0" "Apache 2.0") 'license:asl2.0) + (_ 'unknown-license!)))) (define (php-package? package) "Return true if PACKAGE is a PHP package from Packagist." -- 2.41.0