gnu-maintenance: 'gnu' and 'gnu-ftp' predicates catch networking errors.

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.
This commit is contained in:
Ludovic Courtès 2023-01-03 14:53:03 +01:00
parent f3edf29c67
commit 472dd29f37
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -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