diff options
author | Ludovic Courtès <ludo@gnu.org> | 2015-09-24 21:54:37 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2015-09-24 21:54:37 +0200 |
commit | 75726135ce017f37ae57181e011ceea95c56dd3a (patch) | |
tree | 069ea352ae256acba92a5117a9f22414275c6121 | |
parent | 7a8ac75a947f2cd2863f9b9d490d3e284fbef701 (diff) | |
download | guix-75726135ce017f37ae57181e011ceea95c56dd3a.tar.gz |
download: Don't abbreviate things that are not store items.
Fixes a regression introduced in a8be7b9a. * guix/build/download.scm (store-path-abbreviation): Return STORE-PATH if it's not an actual store path. Fixes an out-of-range exception when running tests/substitute.scm and tests/store.scm.
-rw-r--r-- | guix/build/download.scm | 15 |
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)) |