all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: 60520@debbugs.gnu.org
Cc: "Ludovic Courtès" <ludo@gnu.org>
Subject: [bug#60520] [PATCH 3/4] import: stackage: Catch networking errors in predicate.
Date: Tue,  3 Jan 2023 18:03:18 +0100	[thread overview]
Message-ID: <20230103170319.16637-3-ludo@gnu.org> (raw)
In-Reply-To: <20230103170319.16637-1-ludo@gnu.org>

* guix/import/stackage.scm (stackage-lts-package?): Wrap body in
'false-if-networking-error'.
---
 guix/import/stackage.scm | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/guix/import/stackage.scm b/guix/import/stackage.scm
index 70d3e271f4..c0284e48a4 100644
--- a/guix/import/stackage.scm
+++ b/guix/import/stackage.scm
@@ -3,7 +3,7 @@
 ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
 ;;; Copyright © 2021 Xinglu Chem <public@yoctocell.xyz>
-;;; Copyright © 2021 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2021, 2023, 2023 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2022 Hartmut Goebel <h.goebel@crazy-compilers.com>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -170,12 +170,13 @@ (define latest-lts-release
 (define (stackage-lts-package? package)
   "Return whether PACKAGE is available on the default Stackage LTS release."
   (and (hackage-package? package)
-       (let ((packages (stackage-lts-packages
-                        (stackage-lts-info-fetch %default-lts-version)))
-             (hackage-name (guix-package->hackage-name package)))
-         (find (lambda (package)
-                 (string=? (stackage-package-name package) hackage-name))
-               packages))))
+       (false-if-networking-error
+        (let ((packages (stackage-lts-packages
+                         (stackage-lts-info-fetch %default-lts-version)))
+              (hackage-name (guix-package->hackage-name package)))
+          (find (lambda (package)
+                  (string=? (stackage-package-name package) hackage-name))
+                packages)))))
 
 (define %stackage-updater
   (upstream-updater
-- 
2.38.1





  parent reply	other threads:[~2023-01-03 17:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-03 16:44 [bug#60520] [PATCH 0/4] Tests for 'guix refresh' Ludovic Courtès
2023-01-03 17:03 ` [bug#60520] [PATCH 1/4] gnu-maintenance: Factorize 'false-if-networking-failure' Ludovic Courtès
2023-01-03 17:03   ` [bug#60520] [PATCH 2/4] gnu-maintenance: 'gnu' and 'gnu-ftp' predicates catch networking errors Ludovic Courtès
2023-01-03 17:03   ` Ludovic Courtès [this message]
2023-01-03 17:03   ` [bug#60520] [PATCH 4/4] refresh: Add CLI tests Ludovic Courtès
2023-01-03 18:51 ` [bug#60520] [PATCH 0/4] Tests for 'guix refresh' Hartmut Goebel
2023-01-08 15:16   ` bug#60520: " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230103170319.16637-3-ludo@gnu.org \
    --to=ludo@gnu.org \
    --cc=60520@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.