aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-06-22 16:10:25 +0200
committerLudovic Courtès <ludo@gnu.org>2013-06-22 16:10:25 +0200
commit91a7fde45654b2d78cd791542e6a18dbbedd7297 (patch)
tree0ea1df301091ce528bcc383aefe4bfd32fd2e204
parentf3211ef3868326e3cec5318bc799a2ff6572741b (diff)
downloadguix-91a7fde45654b2d78cd791542e6a18dbbedd7297.tar
guix-91a7fde45654b2d78cd791542e6a18dbbedd7297.tar.gz
download: Don't fail when abbreviating `file://' URIs.
* guix/build/download.scm (uri-abbreviation)[elide-path]: Handle the case where URI has no `host' part.
-rw-r--r--guix/build/download.scm7
1 files changed, 5 insertions, 2 deletions
diff --git a/guix/build/download.scm b/guix/build/download.scm
index dcce0bfc89..ac2086d96e 100644
--- a/guix/build/download.scm
+++ b/guix/build/download.scm
@@ -65,8 +65,11 @@ abbreviation of URI showing the scheme, host, and basename of the file."
(define (elide-path)
(let ((path (uri-path uri)))
- (string-append (symbol->string (uri-scheme uri))
- "://" (uri-host uri)
+ (string-append (symbol->string (uri-scheme uri)) "://"
+
+ ;; `file' URIs have no host part.
+ (or (uri-host uri) "")
+
(string-append "/.../" (basename path)))))
(if (> (string-length uri-as-string) max-length)