summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-05-27 10:29:10 +0200
committerLudovic Courtès <ludo@gnu.org>2016-05-27 10:37:11 +0200
commitdab2472c6a24630db7c524cb997d358a33820ffd (patch)
treeb66eb281ea12d7d425e66bca4954fea8198ab90a
parentd345491ab4896dcf4f492bc4c8c7df2387991071 (diff)
downloadguix-dab2472c6a24630db7c524cb997d358a33820ffd.tar.gz
download: Use URI objects for content-addressed mirrors.
This fixes a bug whereby 'http-fetch' would be passed a string instead
of a URI object.

* guix/build/download.scm (url-fetch): Rename 'content-addressed-urls'
to 'content-addressed-uris', and call 'string->uri'.
-rw-r--r--guix/build/download.scm6
1 files changed, 3 insertions, 3 deletions
diff --git a/guix/build/download.scm b/guix/build/download.scm
index 7741726c41..ef515efdbf 100644
--- a/guix/build/download.scm
+++ b/guix/build/download.scm
@@ -719,11 +719,11 @@ or #f."
                uri)
        #f)))
 
-  (define content-addressed-urls
+  (define content-addressed-uris
     (append-map (lambda (make-url)
                   (filter-map (match-lambda
                                 ((hash-algo . hash)
-                                 (make-url hash-algo hash)))
+                                 (string->uri (make-url hash-algo hash))))
                               hashes))
                 content-addressed-mirrors))
 
@@ -733,7 +733,7 @@ or #f."
 
   (setvbuf (current-error-port) _IOLBF)
 
-  (let try ((uri (append uri content-addressed-urls)))
+  (let try ((uri (append uri content-addressed-uris)))
     (match uri
       ((uri tail ...)
        (or (fetch uri file)