From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 4LgwCVwqaGHz9QAAgWs5BA (envelope-from ) for ; Thu, 14 Oct 2021 15:02:20 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id qJ+uBFwqaGFldgAAbx9fmQ (envelope-from ) for ; Thu, 14 Oct 2021 13:02:20 +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 91A5913502 for ; Thu, 14 Oct 2021 15:02:19 +0200 (CEST) Received: from localhost ([::1]:60106 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb0NG-0007kb-NH for larch@yhetil.org; Thu, 14 Oct 2021 09:02:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb0N2-0007gP-Lp for guix-patches@gnu.org; Thu, 14 Oct 2021 09:02:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:51636) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mb0N0-0000s8-Gv for guix-patches@gnu.org; Thu, 14 Oct 2021 09:02:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mb0N0-0003Bt-El for guix-patches@gnu.org; Thu, 14 Oct 2021 09:02:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#51091] [PATCH] guix: opam: Do not fail when refreshing. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 14 Oct 2021 13:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51091 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Xinglu Chen Cc: Julien Lepiller , 51091@debbugs.gnu.org Received: via spool by 51091-submit@debbugs.gnu.org id=B51091.163421649212218 (code B ref 51091); Thu, 14 Oct 2021 13:02:02 +0000 Received: (at 51091) by debbugs.gnu.org; 14 Oct 2021 13:01:32 +0000 Received: from localhost ([127.0.0.1]:34949 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mb0MV-0003Az-Nm for submit@debbugs.gnu.org; Thu, 14 Oct 2021 09:01:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56494) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mb0MT-0003An-Dm for 51091@debbugs.gnu.org; Thu, 14 Oct 2021 09:01:30 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:46244) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb0ML-0000Od-Gc; Thu, 14 Oct 2021 09:01:22 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=58018 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb0MK-0007qW-IQ; Thu, 14 Oct 2021 09:01:21 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20211008050310.407d6b23@tachikoma.lepiller.eu> <87y272lepg.fsf@yoctocell.xyz> Date: Thu, 14 Oct 2021 15:01:18 +0200 In-Reply-To: <87y272lepg.fsf@yoctocell.xyz> (Xinglu Chen's message of "Sat, 09 Oct 2021 11:39:23 +0200") Message-ID: <871r4nrc9t.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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=1634216539; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: 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=Y0i6SQjD3HE7Z7XW5E3pLliDZIgyVT7SsVDLgnHB+K8=; b=MvfPu7a9dHSIHQLVzEoDukk0x0o6M3OXSD9xKwKO3V7vGnTi3ODr1hBqC8z97uIFvd6fP1 D4cSXEre3/kP/BhSFBSNjdliCVQ5WVITRcT7Xa4SLJOsmjbApiyKqJvIYTiD8i7TFO1ZzE nDRYHvzXkcKfWbUu1ayiMCHblUjngBmliPLWtt0CNS8W5QHof0C1UHftwotw07gkjaDV1M vCuytj2lB1HJX1ZsX97oAtKaSNgWE2eRsTIcYiVPNMHws8fGFA6gm/GNHUDz03venFVB/v KvlihIfW7HzPgvFFyZM3QK59Jo/IC8Xchw0/tKVro9zF2soF3ob6GQmXgfAbdQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1634216539; a=rsa-sha256; cv=none; b=Bp8yPR0N0lL9aE6rmQNfgX4Ba0JKaKik6JqtP8jM21JntNXQI2+kwU/rVUgsIgp5Lr5McW u6T0F+b3F+LSYHiXOTpyAptX8dI3IZYxbMAVyCrrJDaupL4uWai4CktVRabrBkf6xnO1iy zhXu/6Vs+TgEry0ISSHGg+ktGeKiaViUm3yoh3PlGCKcinSt03Epnr+lVxCpGe1nYdVqsA vsbWHdqe7zGE3h3FGl5mQSuv4srgfEFUPYKdtX0IBkSUL+ENaKk7/djLRv+JZYIczBo5o6 P1PTSSfa8S/QbqU25L7mDsil+0fQ79pdLGlPdYqiwaioczUJQkVpu1Gq5Db0vw== ARC-Authentication-Results: i=1; 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-Spam-Score: -2.91 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: 91A5913502 X-Spam-Score: -2.91 X-Migadu-Scanner: scn0.migadu.com X-TUID: mC4JMcyR3BkB Hi, Xinglu Chen skribis: > On Fri, Oct 08 2021, Julien Lepiller wrote: [...] >> Because we throw an error when a package is not in the opam repository, >> the updater would crash when encountering a package that is not in opam >> but uses the ocaml-build-system, such as opam itself. This catches the >> error and continues without updating said package, and lets us update >> the rest of the packages. >> >> * guix/import/opam.scm (latest-release): Catch errors and do not crash. >> --- >> guix/import/opam.scm | 23 +++++++++++++---------- >> 1 file changed, 13 insertions(+), 10 deletions(-) >> >> diff --git a/guix/import/opam.scm b/guix/import/opam.scm >> index fe13d29f03..8ff1a3ae63 100644 >> --- a/guix/import/opam.scm >> +++ b/guix/import/opam.scm >> @@ -409,16 +409,19 @@ package in OPAM." >>=20=20 >> (define (latest-release package) >> "Return an for the latest release of PACKAGE." >> - (and-let* ((opam-name (guix-package->opam-name package)) >> - (opam-file (opam-fetch opam-name)) >> - (version (assoc-ref opam-file "version")) >> - (opam-content (assoc-ref opam-file "metadata")) >> - (url-dict (metadata-ref opam-content "url")) >> - (source-url (metadata-ref url-dict "src"))) >> - (upstream-source >> - (package (package-name package)) >> - (version version) >> - (urls (list source-url))))) >> + (catch #t > > Using (catch #t ...) is generally not a good idea. Maybe =E2=80=98opam-f= etch=E2=80=99 should > raise a =E2=80=98opam-fetch=E2=80=99 condition, and then we would only ca= tch those > conditions? Agreed, it=E2=80=99s best to catch the most specific exception, around the = most narrow bits of code, so unexpected errors that denote bugs are properly reported. Nitpick: in the commit log, the subject line should start with =E2=80=9Cimport: opam:=E2=80=9D. :-) Thanks, Ludo=E2=80=99.