From 993fb66dd2f3087fef12c3f3f31e42485dfeb1bf Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 16 Mar 2013 00:59:19 +0100 Subject: guix package: Gracefully handle `official-gnu-packages' failure. * guix/gnu-maintenance.scm (http-fetch): Error out when DATA is #f. * guix/scripts/package.scm (check-package-freshness): Wrap `gnu-package?' call in `false-if-exception'. Reported by Cyril Roelandt . --- guix/gnu-maintenance.scm | 15 ++++++++++++++- guix/scripts/package.scm | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'guix') diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm index cde31aaa7b..89a01741ec 100644 --- a/guix/gnu-maintenance.scm +++ b/guix/gnu-maintenance.scm @@ -56,7 +56,20 @@ (define (http-fetch uri) (response-code resp))) (case code ((200) - data) + (if data + data + (begin + ;; XXX: Guile 2.0.5 and earlier did not support chunked transfer + ;; encoding, which is required when fetching %PACKAGE-LIST-URL + ;; (see ). + ;; Since users may still be using these versions, warn them and + ;; bail out. + (format (current-error-port) + "warning: using Guile ~a, which does not support HTTP ~s encoding~%" + (version) + (response-transfer-encoding resp)) + (error "download failed; use a newer Guile" + uri resp)))) (else (error "download failed:" uri code (response-reason-phrase resp)))))) diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index a9ed79184e..f14677c519 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -288,7 +288,7 @@ (define (check-package-freshness package) (catch #t (lambda () - (when (gnu-package? package) + (when (false-if-exception (gnu-package? package)) (let ((name (package-name package)) (full-name (package-full-name package))) (match (waiting (latest-release name) -- cgit v1.2.3