summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-03-05 22:24:19 +0100
committerLudovic Courtès <ludo@gnu.org>2013-03-05 22:24:19 +0100
commit19777ae6ea35cfe4d23ae7096751971c3bf86722 (patch)
treea9c103ada3e7871583f5d18d3903a49a074ed914
parentef010c0f3d414f7107de80e0835d1e347b04315b (diff)
downloadpatches-19777ae6ea35cfe4d23ae7096751971c3bf86722.tar
patches-19777ae6ea35cfe4d23ae7096751971c3bf86722.tar.gz
guix package: Recover from freshness check transient errors.
* guix/scripts/package.scm (check-package-freshness): Ignore `getaddrinfo-error' and `ftp-error' exceptions.
-rw-r--r--guix/scripts/package.scm33
1 files changed, 21 insertions, 12 deletions
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index 61b2f0570d..dd7d6ca112 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -285,19 +285,28 @@ matching packages."
"Check whether PACKAGE has a newer version available upstream, and report
it."
;; TODO: Automatically inject the upstream version when desired.
- (when (gnu-package? package)
- (let ((name (package-name package))
- (full-name (package-full-name package)))
- (match (waiting (latest-release name)
- (_ "looking for the latest release of GNU ~a...") name)
- ((latest-version . _)
- (when (version>? latest-version full-name)
- (format (current-error-port)
- (_ "~a: note: using ~a \
+
+ (catch #t
+ (lambda ()
+ (when (gnu-package? package)
+ (let ((name (package-name package))
+ (full-name (package-full-name package)))
+ (match (waiting (latest-release name)
+ (_ "looking for the latest release of GNU ~a...") name)
+ ((latest-version . _)
+ (when (version>? latest-version full-name)
+ (format (current-error-port)
+ (_ "~a: note: using ~a \
but ~a is available upstream~%")
- (location->string (package-location package))
- full-name latest-version)))
- (_ #t)))))
+ (location->string (package-location package))
+ full-name latest-version)))
+ (_ #t)))))
+ (lambda (key . args)
+ ;; Silently ignore networking errors rather than preventing
+ ;; installation.
+ (case key
+ ((getaddrinfo-error ftp-error) #f)
+ (else (apply throw key args))))))
;;;