diff mbox series

[bug#60520,2/4] gnu-maintenance: 'gnu' and 'gnu-ftp' predicates catch networking errors.

Message ID 20230103170319.16637-2-ludo@gnu.org
State New
Headers show
Series Tests for 'guix refresh' | expand

Commit Message

Ludovic Courtès Jan. 3, 2023, 5:03 p.m. UTC
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 mbox series

Patch

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