From patchwork Fri Oct 8 03:03:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Lepiller X-Patchwork-Id: 33687 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 B846327BBE3; Fri, 8 Oct 2021 04:04:31 +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_H2,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 49B0B27BBE1 for ; Fri, 8 Oct 2021 04:04:31 +0100 (BST) Received: from localhost ([::1]:58742 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mYgBS-0008Fx-Ca for patchwork@mira.cbaines.net; Thu, 07 Oct 2021 23:04:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42472) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mYgB0-0008Fa-Mr for guix-patches@gnu.org; Thu, 07 Oct 2021 23:04:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:37291) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mYgB0-0006pU-F0 for guix-patches@gnu.org; Thu, 07 Oct 2021 23:04:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mYgB0-0008Vd-4v for guix-patches@gnu.org; Thu, 07 Oct 2021 23:04:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#51091] [PATCH] guix: opam: Do not fail when refreshing. Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 08 Oct 2021 03:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 51091 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 51091@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.163366221032667 (code B ref -1); Fri, 08 Oct 2021 03:04:01 +0000 Received: (at submit) by debbugs.gnu.org; 8 Oct 2021 03:03:30 +0000 Received: from localhost ([127.0.0.1]:48837 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mYgAU-0008Up-0q for submit@debbugs.gnu.org; Thu, 07 Oct 2021 23:03:30 -0400 Received: from lists.gnu.org ([209.51.188.17]:33918) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mYgAR-0008Uh-Cn for submit@debbugs.gnu.org; Thu, 07 Oct 2021 23:03:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42274) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mYgAR-0008E1-75 for guix-patches@gnu.org; Thu, 07 Oct 2021 23:03:27 -0400 Received: from lepiller.eu ([2a00:5884:8208::1]:51800) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mYgAP-0006CR-71 for guix-patches@gnu.org; Thu, 07 Oct 2021 23:03:27 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id db01a4e0 for ; Fri, 8 Oct 2021 03:03:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:subject:message-id:mime-version:content-type; s=dkim; bh=yI9 fZGZhjczlkOFc6NsEYs/GjssuS0LYfAAHwV4JA9w=; b=cmhcGEOUiVS4wFw0mPg 3OuWUWZeVd6mfOyt1jjtdRhNpQPWz3ERqYh+qhHC1Ra+vfG4U+90Br93280egwBp H+rcpp5aVA4MVrjJrlk/2h2nz4OGcNfECTn4PkLwm2oM4UyVYoCknR/ONxX2PLNu FJYwjOQFHuqCkcLoj7NRhSklJ8ny2XQ/QrAW/UtcW0N9lY46kNrck+Mwv34eouPa vL06L8zEi9G6drMXctRJGotXj50ZlZcgTe64xJ72QvcqkOmmbiWPY8YGk6c3mP0c WZXJJgL525N0PZCVG+0uQbEcoQ39DOPbdyEJ9XSHMTUYCKbVFYPEG7bWwOB3uPHd cvg== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id ba079159 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for ; Fri, 8 Oct 2021 03:03:19 +0000 (UTC) Date: Fri, 8 Oct 2021 05:03:10 +0200 From: Julien Lepiller Message-ID: <20211008050310.407d6b23@tachikoma.lepiller.eu> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:5884:8208::1; envelope-from=julien@lepiller.eu; helo=lepiller.eu X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham 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 Hi Guix! the attached patch prevents early failures in "guix refresh -t opam". It will now simply continue when it encounters a package that is not in the opam repository. From f6260b762dd78772e0d90d96dd92d22346a09007 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Fri, 8 Oct 2021 04:58:27 +0200 Subject: [PATCH] guix: opam: Do not fail when refreshing. 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." (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 + (lambda _ + (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))))) + (const #f))) (define %opam-updater (upstream-updater -- 2.33.0