summaryrefslogtreecommitdiff
path: root/guix/build
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2015-10-07 23:55:17 -0400
committerMark H Weaver <mhw@netris.org>2015-10-07 23:55:17 -0400
commit319fe79dd01e03c4ef61311c336bcd77e1133f02 (patch)
treec169d85b429a801fdc22ce27c25b7e4230eb320a /guix/build
parent9511de1ef8c59788f2c93ae6b0cb1e87e30824ab (diff)
parenta606ed89d4e3737beec2f3392bedba61904778f4 (diff)
downloadguix-patches-319fe79dd01e03c4ef61311c336bcd77e1133f02.tar
guix-patches-319fe79dd01e03c4ef61311c336bcd77e1133f02.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'guix/build')
-rw-r--r--guix/build/download.scm9
1 files changed, 8 insertions, 1 deletions
diff --git a/guix/build/download.scm b/guix/build/download.scm
index 4b7c53d2c6..240e79ee8d 100644
--- a/guix/build/download.scm
+++ b/guix/build/download.scm
@@ -110,6 +110,13 @@ column."
(padding (make-string num-spaces #\space)))
(string-append left padding right)))
+(define* (ellipsis #:optional (port (current-output-port)))
+ "Make a rough guess at whether Unicode's HORIZONTAL ELLIPSIS can be written
+in PORT's encoding, and return either that or ASCII dots."
+ (if (equal? (port-encoding port) "UTF-8")
+ "…"
+ "..."))
+
(define* (store-path-abbreviation store-path #:optional (prefix-length 6))
"If STORE-PATH is the file name of a store entry, return an abbreviation of
STORE-PATH for display, showing PREFIX-LENGTH characters of the hash.
@@ -117,7 +124,7 @@ Otherwise return STORE-PATH."
(if (string-prefix? (%store-directory) store-path)
(let ((base (basename store-path)))
(string-append (string-take base prefix-length)
- "…"
+ (ellipsis)
(string-drop base 32)))
store-path))