summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-12-29 20:52:08 +0100
committerLudovic Courtès <ludo@gnu.org>2014-12-29 21:19:17 +0100
commit1c69e4ce3f33242ee8d209b8078fc78a73355446 (patch)
treef37b7de803930a971d1f84ff429110f7e5fa806d
parentdd8ea244f4e6cb2c9cb0e926e1303bf4d7b113ae (diff)
downloadguix-1c69e4ce3f33242ee8d209b8078fc78a73355446.tar.gz
list-packages: Expand 'mirror://' URIs for patches.
* build-aux/list-packages.scm (package->sxml)[patches](patch-url): Use
  'maybe-expand-mirrors' to get the real URL.
-rwxr-xr-xbuild-aux/list-packages.scm11
1 files changed, 8 insertions, 3 deletions
diff --git a/build-aux/list-packages.scm b/build-aux/list-packages.scm
index 6e0455a7a0..c55e84a76b 100755
--- a/build-aux/list-packages.scm
+++ b/build-aux/list-packages.scm
@@ -27,6 +27,8 @@ exec guile -l "$0"                              \
   #:use-module (guix packages)
   #:use-module (guix licenses)
   #:use-module (guix gnu-maintenance)
+  #:use-module ((guix download) #:select (%mirrors))
+  #:use-module ((guix build download) #:select (maybe-expand-mirrors))
   #:use-module (gnu packages)
   #:use-module (sxml simple)
   #:use-module (sxml fold)
@@ -107,9 +109,12 @@ decreasing, is 1."
          "http://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/patches/"
          (basename patch)))
        ((? origin? patch)
-        (match (origin-uri patch)
-          ((? string? uri) uri)
-          ((head . tail) head)))))
+        (uri->string
+         (first (maybe-expand-mirrors (string->uri
+                                       (match (origin-uri patch)
+                                         ((? string? uri) uri)
+                                         ((head . tail) head)))
+                                      %mirrors))))))
 
     (define patch-name
       (match-lambda