summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--guix/build/download.scm15
1 files changed, 9 insertions, 6 deletions
diff --git a/guix/build/download.scm b/guix/build/download.scm
index be4a5810af..4b7c53d2c6 100644
--- a/guix/build/download.scm
+++ b/guix/build/download.scm
@@ -111,12 +111,15 @@ column."
(string-append left padding right)))
(define* (store-path-abbreviation store-path #:optional (prefix-length 6))
- "Return an abbreviation of STORE-PATH for display, showing PREFIX-LENGTH
-characters of the hash."
- (let ((base (basename store-path)))
- (string-append (string-take base prefix-length)
- "…"
- (string-drop base 32))))
+ "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.
+Otherwise return STORE-PATH."
+ (if (string-prefix? (%store-directory) store-path)
+ (let ((base (basename store-path)))
+ (string-append (string-take base prefix-length)
+ "…"
+ (string-drop base 32)))
+ store-path))
(define* (progress-proc file size
#:optional (log-port (current-output-port))