From patchwork Mon May 17 20:11:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Xinglu Chen X-Patchwork-Id: 29393 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id B69B927BC81; Mon, 17 May 2021 21:12:14 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 5E71027BC78 for ; Mon, 17 May 2021 21:12:14 +0100 (BST) Received: from localhost ([::1]:42698 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lijb3-0000R4-Kt for patchwork@mira.cbaines.net; Mon, 17 May 2021 16:12:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37420) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lijat-0000PS-CJ for guix-patches@gnu.org; Mon, 17 May 2021 16:12:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42334) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lijas-0000JD-AQ for guix-patches@gnu.org; Mon, 17 May 2021 16:12:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lijas-000212-6J for guix-patches@gnu.org; Mon, 17 May 2021 16:12:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48486] [PATCH] import: hackage: Prefix licenses with Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 17 May 2021 20:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 48486 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48486@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16212822957710 (code B ref -1); Mon, 17 May 2021 20:12:02 +0000 Received: (at submit) by debbugs.gnu.org; 17 May 2021 20:11:35 +0000 Received: from localhost ([127.0.0.1]:53880 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lijaL-00020B-OL for submit@debbugs.gnu.org; Mon, 17 May 2021 16:11:35 -0400 Received: from lists.gnu.org ([209.51.188.17]:43704) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lijaI-000202-TK for submit@debbugs.gnu.org; Mon, 17 May 2021 16:11:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37322) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lijaG-0008Rk-Qq for guix-patches@gnu.org; Mon, 17 May 2021 16:11:25 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:40358 helo=mail.yoctocell.xyz) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lijaA-0008K8-SK for guix-patches@gnu.org; Mon, 17 May 2021 16:11:24 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1621282275; bh=eNqZdaLAgEnder+Ko8LJbMkJtqxUOv2WZKJvMhhcdcs=; h=From:To:Subject:Date; b=KjjwyRn2209W60h4uVbxXxKvntmhB+S86kXdVViSxVKLAF/bMSg4YVDy2UwWhGjFU 3+vQrZuFmNlTIz2CUWaHbhA1dAk6I2WpYmynDAoj1bQH9aYnkS0oaJyL7wlih9NppA ressX7cJtazLh5SXrCKs/pf+ch+j8J58qDOZiSL0= Message-Id: <309e06a20c461e996478acd4c5020f930eccc869.1621282211.git.public@yoctocell.xyz> Date: Mon, 17 May 2021 22:11:15 +0200 MIME-Version: 1.0 Received-SPF: pass client-ip=87.96.130.155; envelope-from=public@yoctocell.xyz; helo=mail.yoctocell.xyz X-Spam_score_int: 25 X-Spam_score: 2.5 X-Spam_bar: ++ X-Spam_report: (2.5 / 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, FROM_SUSPICIOUS_NTLD=0.499, FROM_SUSPICIOUS_NTLD_FP=1.13, PDS_OTHER_BAD_TLD=1.999, RDNS_DYNAMIC=0.982, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * guix/import/hackage.scm (string->license): Prefix the value of the license field with ‘license:’. * tests/hackage.scm (match-ghc-foo, match-ghc-foo-6, match-ghc-foo-revision): Adjust accordingly. --- guix/import/hackage.scm | 27 ++++++++++++++------------- tests/hackage.scm | 7 ++++--- 2 files changed, 18 insertions(+), 16 deletions(-) base-commit: 938ffcbb0589adc07dc12c79eda3e1e2bb9e7cf8 diff --git a/guix/import/hackage.scm b/guix/import/hackage.scm index 9f992ffe8e..f94a1e7087 100644 --- a/guix/import/hackage.scm +++ b/guix/import/hackage.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2016 Nikita ;;; Copyright © 2018 Ricardo Wurmus ;;; Copyright © 2019 Robert Vollmert +;;; Copyright © 2021 Xinglu Chen ;;; ;;; This file is part of GNU Guix. ;;; @@ -163,22 +164,22 @@ version." ;; https://www.haskell.org ;; /cabal/release/cabal-latest/doc/API/Cabal/Distribution-License.html. (match-lambda - ("GPL-2" 'gpl2) - ("GPL-3" 'gpl3) + ("GPL-2" 'license:gpl2) + ("GPL-3" 'license:gpl3) ("GPL" "'gpl??") - ("AGPL-3" 'agpl3) + ("AGPL-3" 'license:agpl3) ("AGPL" "'agpl??") - ("LGPL-2.1" 'lgpl2.1) - ("LGPL-3" 'lgpl3) + ("LGPL-2.1" 'license:lgpl2.1) + ("LGPL-3" 'license:lgpl3) ("LGPL" "'lgpl??") - ("BSD2" 'bsd-2) - ("BSD3" 'bsd-3) - ("BSD-3-Clause" 'bsd-3) - ("MIT" 'expat) - ("ISC" 'isc) - ("MPL" 'mpl2.0) - ("Apache-2.0" 'asl2.0) - ("PublicDomain" 'public-domain) + ("BSD2" 'license:bsd-2) + ("BSD3" 'license:bsd-3) + ("BSD-3-Clause" 'license:bsd-3) + ("MIT" 'license:expat) + ("ISC" 'license:isc) + ("MPL" 'license:mpl2.0) + ("Apache-2.0" 'license:asl2.0) + ("PublicDomain" 'license:public-domain) ((x) (string->license x)) ((lst ...) `(list ,@(map string->license lst))) (_ #f))) diff --git a/tests/hackage.scm b/tests/hackage.scm index 77e333cbfc..66a13d9881 100644 --- a/tests/hackage.scm +++ b/tests/hackage.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015 Federico Beffa ;;; Copyright © 2019 Robert Vollmert +;;; Copyright © 2021 Xinglu Chen ;;; ;;; This file is part of GNU Guix. ;;; @@ -183,7 +184,7 @@ library ('home-page "http://test.org") ('synopsis (? string?)) ('description (? string?)) - ('license 'bsd-3))) + ('license 'license:bsd-3))) (define* (eval-test-with-cabal test-cabal matcher #:key (cabal-environment '())) (define port (open-input-string test-cabal)) @@ -232,7 +233,7 @@ library ('home-page "http://test.org") ('synopsis (? string?)) ('description (? string?)) - ('license 'bsd-3))) + ('license 'license:bsd-3))) (test-assert "hackage->guix-package test 6" (eval-test-with-cabal test-cabal-6 match-ghc-foo-6)) @@ -362,7 +363,7 @@ executable cabal ('home-page "http://test.org") ('synopsis (? string?)) ('description (? string?)) - ('license 'bsd-3))) + ('license 'license:bsd-3))) (test-assert "hackage->guix-package test cabal revision" (eval-test-with-cabal test-cabal-revision match-ghc-foo-revision))