diff options
author | Ludovic Courtès <ludo@gnu.org> | 2013-03-16 00:59:19 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2013-03-16 00:59:19 +0100 |
commit | 993fb66dd2f3087fef12c3f3f31e42485dfeb1bf (patch) | |
tree | c5da80be7c7262bd57c5990b42cff33288f59e92 /guix/gnu-maintenance.scm | |
parent | 3be9f724f58b0e0ec3a905de3a29d0b54bcb7628 (diff) | |
download | gnu-guix-993fb66dd2f3087fef12c3f3f31e42485dfeb1bf.tar gnu-guix-993fb66dd2f3087fef12c3f3f31e42485dfeb1bf.tar.gz |
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 <tipecaml@gmail.com>.
Diffstat (limited to 'guix/gnu-maintenance.scm')
-rw-r--r-- | guix/gnu-maintenance.scm | 15 |
1 files changed, 14 insertions, 1 deletions
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 @@ (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 <http://lists.gnu.org/archive/html/guile-devel/2011-09/msg00089.html>). + ;; 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)))))) |