From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id P6aBLFQnVmG6RAEAgWs5BA (envelope-from ) for ; Thu, 30 Sep 2021 23:08:36 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id JbGdJ1QnVmFPGgAAB5/wlQ (envelope-from ) for ; Thu, 30 Sep 2021 21:08:36 +0000 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 5CD6A2B57B for ; Thu, 30 Sep 2021 23:08:36 +0200 (CEST) Received: from localhost ([::1]:38610 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mW3IB-00067z-Dw for larch@yhetil.org; Thu, 30 Sep 2021 17:08:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33296) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mW3Co-00076O-9O for guix-patches@gnu.org; Thu, 30 Sep 2021 17:03:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42604) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mW3Co-0004Jy-0A for guix-patches@gnu.org; Thu, 30 Sep 2021 17:03:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mW3Cn-00068p-TA for guix-patches@gnu.org; Thu, 30 Sep 2021 17:03:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50922] [PATCH 2/2] import: stackage: Use the standard diagnostic procedures. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 30 Sep 2021 21:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50922 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50922@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 50922-submit@debbugs.gnu.org id=B50922.163303572323524 (code B ref 50922); Thu, 30 Sep 2021 21:03:01 +0000 Received: (at 50922) by debbugs.gnu.org; 30 Sep 2021 21:02:03 +0000 Received: from localhost ([127.0.0.1]:54148 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mW3Bq-000677-BG for submit@debbugs.gnu.org; Thu, 30 Sep 2021 17:02:02 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56186) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mW3Bo-00066k-0A for 50922@debbugs.gnu.org; Thu, 30 Sep 2021 17:02:00 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:59944) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mW3Bi-0003XE-OZ; Thu, 30 Sep 2021 17:01:54 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36446 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mW3Bi-0006lk-CU; Thu, 30 Sep 2021 17:01:54 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Thu, 30 Sep 2021 23:01:44 +0200 Message-Id: <20210930210144.1798-2-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210930210144.1798-1-ludo@gnu.org> References: <20210930210144.1798-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1633036116; h=from:from:sender:sender: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=jFlqeJnIx7djmN7m83HCaHjLyI1uCBUsPBpxLbfbxCM=; b=RYDMLTZkaaVj6L6DiOBC0VBfp/eHLs3ceWVGczevEujlnwBQeIv+K4XQdQoKpKrfPwTl1C Dbdd8SxC6HcqfH9r4RbE00BZtLgI7Rq5zCPBpm2NvuiDdQIhPsSEK+C9sjMLIlafmWV1UV peHXmv4EiBawZ3FXes6x6YhFjiqO95f+St0D+ql2ll9JNyjWgGmRpgslUheQiSZci0E/8j G1yGR6uNiZCwfnqEFNThUqBCkhwBr/JEA3Tae95b3Kn9OzMQhx5M38DzmYNXbud7uhd+NJ sX5Z7LDQ7gQPzwDhEQpsyeTedg1JL5109ORUakAsd/cvk4B1DGe0DwPjTrfTnw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1633036116; a=rsa-sha256; cv=none; b=h7/z/ws2nn01AFoAy6DM3tSYPN3iOPV+cD/Mq8NINxWB4rheQj2IajaeGD9ewVCps0elXi EKGRmmYwEVazSK2jtIJCvJpKeXCUfFnlNu9xFRYLmcqPcqmp5FcaWkSf56WMjH7/4OT7Be ojYV/bqwslOhYBOznST9AcX7zhbjoFeSS+no3FPsWdLNjgtNe/feeSz/24OIADI/GlH7Jl DP/4okhAovZvNWNkwUIBNcqZBr83JySTQ8rzviPelgjQQkMlgR5oeLASDwy/Nn7Kglp4JU hAfDP9a6qp3ArKlYah39Wa0eyFYUBHXTWqL/3Q9xDo/XfxVGXYrzY6OQRHbTeQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 1.30 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 5CD6A2B57B X-Spam-Score: 1.30 X-Migadu-Scanner: scn1.migadu.com X-TUID: WQlNi8P/wyxP * guix/import/stackage.scm (leave-with-message): Remove. (stackage-lts-info-fetch): Use 'raise' and 'formatted-message'. (stackage->guix-package): Likewise. (latest-lts-release): Use 'warning' instead of 'format'. --- guix/import/stackage.scm | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/guix/import/stackage.scm b/guix/import/stackage.scm index 4eff09ad01..b4b20ebcf0 100644 --- a/guix/import/stackage.scm +++ b/guix/import/stackage.scm @@ -32,6 +32,8 @@ #:use-module (guix memoization) #:use-module (guix packages) #:use-module (guix upstream) + #:use-module (guix diagnostics) + #:use-module (guix i18n) #:export (%stackage-url stackage->guix-package stackage-recursive-import @@ -71,9 +73,6 @@ (version stackage-package-version) (synopsis stackage-package-synopsis)) -(define (leave-with-message fmt . args) - (raise (condition (&message (message (apply format #f fmt args)))))) - (define stackage-lts-info-fetch ;; "Retrieve the information about the LTS Stackage release VERSION." (memoize @@ -84,7 +83,8 @@ version))) (lts-info (and=> (json-fetch url) json->stackage-lts))) (or lts-info - (leave-with-message "LTS release version not found: ~a" version)))))) + (raise (formatted-message (G_ "LTS release version not found: ~a") + version))))))) (define (lts-package-version packages name) "Return the version of the package with upstream NAME included in PACKAGES." @@ -120,7 +120,8 @@ included in the Stackage LTS release." (hackage->guix-package name-version #:include-test-dependencies? include-test-dependencies?) - (leave-with-message "~a: Stackage package not found" package-name)))))) + (raise (formatted-message (G_ "~a: Stackage package not found") + package-name))))))) (define (stackage-recursive-import package-name . args) (recursive-import package-name @@ -145,10 +146,10 @@ PACKAGE or #f if the package is not included in the Stackage LTS release." (version (lts-package-version (packages) hackage-name)) (name-version (hackage-name-version hackage-name version))) (match (and=> name-version hackage-fetch) - (#f (format (current-error-port) - "warning: failed to parse ~a~%" - (hackage-cabal-url hackage-name)) - #f) + (#f + (warning (G_ "failed to parse ~a~%") + (hackage-cabal-url hackage-name)) + #f) (_ (let ((url (hackage-source-url hackage-name version))) (upstream-source (package (package-name package)) -- 2.33.0