summaryrefslogtreecommitdiff
path: root/guix/import/elpa.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-10-27 14:43:19 -0700
committerLudovic Courtès <ludo@gnu.org>2017-10-28 09:45:54 +0200
commit0a2ce1ea0ad2f1269cba3f77a77bb336ba2ef0b3 (patch)
tree64fd2b8f1d21b161e94f1b457560983eb61e0600 /guix/import/elpa.scm
parent90297811a9d6412fcf57bd6bef08ded39ac895cc (diff)
import: elpa: Do not abort when failing to download the archive.
* guix/import/elpa.scm (elpa-fetch-archive): Use 'http-fetch/cached' directly instead of 'call-with-downloaded-file'. This ensures we don't just abort when networking access is lacking, which is required to allow 'guix refresh -c refresh' to proceed.
Diffstat (limited to 'guix/import/elpa.scm')
-rw-r--r--guix/import/elpa.scm7
1 files changed, 5 insertions, 2 deletions
diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm
index 858eea88e2..45a419217c 100644
--- a/guix/import/elpa.scm
+++ b/guix/import/elpa.scm
@@ -80,8 +80,11 @@ NAMES (strings)."
(cut string-append <> "/archive-contents"))))
(if url
;; Use a relatively small TTL for the archive itself.
- (parameterize ((%http-cache-ttl (* 6 3600)))
- (call-with-downloaded-file url read))
+ (let* ((port (http-fetch/cached (string->uri url)
+ #:ttl (* 6 3600)))
+ (data (read port)))
+ (close-port port)
+ data)
(leave (G_ "~A: currently not supported~%") repo))))
(define* (call-with-downloaded-file url proc #:optional (error-thunk #f))