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 2/4] gnu-maintenance: 'gnu' and 'gnu-ftp' predicates catch networking errors.
Date: Tue,  3 Jan 2023 18:03:17 +0100	[thread overview]
Message-ID: <20230103170319.16637-2-ludo@gnu.org> (raw)
In-Reply-To: <20230103170319.16637-1-ludo@gnu.org>

Previously, in a networking-less environment such as 'guix shell -C -D
guix', 'guix refresh --list-updaters' would crash due to a
'gettaddrinfo-error' exception in these predicates.

* guix/gnu-maintenance.scm (%gnu-updater)[pred]: Wrap in
'false-if-networking-error'.
(%gnu-ftp-updater)[pred]: Likewise.
---
 guix/gnu-maintenance.scm | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm
index 0418c297f2..0aa70243b5 100644
--- a/guix/gnu-maintenance.scm
+++ b/guix/gnu-maintenance.scm
@@ -883,7 +883,8 @@ (define %gnu-updater
   (upstream-updater
    (name 'gnu)
    (description "Updater for GNU packages")
-   (pred gnu-hosted?)
+   (pred (lambda (package)
+           (false-if-networking-error (gnu-hosted? package))))
    (import import-gnu-release)))
 
 (define %gnu-ftp-updater
@@ -893,8 +894,9 @@ (define %gnu-ftp-updater
    (name 'gnu-ftp)
    (description "Updater for GNU packages only available via FTP")
    (pred (lambda (package)
-           (and (not (gnu-hosted? package))
-                (pure-gnu-package? package))))
+           (false-if-networking-error
+            (and (not (gnu-hosted? package))
+                 (pure-gnu-package? package)))))
    (import import-release*)))
 
 (define %savannah-updater
-- 
2.38.1





  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   ` Ludovic Courtès [this message]
2023-01-03 17:03   ` [bug#60520] [PATCH 3/4] import: stackage: Catch networking errors in predicate Ludovic Courtès
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-2-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.