download: Prepare to support the 'guix publish' /file URLs.
authorLudovic Courtès <ludo@gnu.org>
Wed, 20 Jul 2016 15:00:50 +0000 (17:00 +0200)
committerLudovic Courtès <ludo@gnu.org>
Wed, 20 Jul 2016 15:02:35 +0000 (17:02 +0200)
* guix/download.scm (%content-addressed-mirrors): Add 'file' parameter
to the lambda.
* guix/build/download.scm (url-fetch)[content-addressed-uris]: Adjust
accordingly.

guix/build/download.scm
guix/download.scm

index 103e784..307258b 100644 (file)
@@ -737,7 +737,7 @@ or #f."
     (append-map (lambda (make-url)
                   (filter-map (match-lambda
                                 ((hash-algo . hash)
-                                 (string->uri (make-url hash-algo hash))))
+                                 (string->uri (make-url file hash-algo hash))))
                               hashes))
                 content-addressed-mirrors))
 
index bcb043b..8f38a4f 100644 (file)
 
 (define %content-addressed-mirrors
   ;; List of content-addressed mirrors.  Each mirror is represented as a
-  ;; procedure that takes an algorithm (symbol) and a hash (bytevector), and
-  ;; returns a URL or #f.
+  ;; procedure that takes a file name, an algorithm (symbol) and a hash
+  ;; (bytevector), and returns a URL or #f.
   ;; TODO: Add more.
-  '(list (lambda (algo hash)
+  '(list (lambda (file algo hash)
            ;; 'tarballs.nixos.org' supports several algorithms.
            (string-append "http://tarballs.nixos.org/"
                           (symbol->string algo) "/"