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.
This commit is contained in:
parent
7a8ac75a94
commit
75726135ce
|
@ -111,12 +111,15 @@ column."
|
||||||
(string-append left padding right)))
|
(string-append left padding right)))
|
||||||
|
|
||||||
(define* (store-path-abbreviation store-path #:optional (prefix-length 6))
|
(define* (store-path-abbreviation store-path #:optional (prefix-length 6))
|
||||||
"Return an abbreviation of STORE-PATH for display, showing PREFIX-LENGTH
|
"If STORE-PATH is the file name of a store entry, return an abbreviation of
|
||||||
characters of the hash."
|
STORE-PATH for display, showing PREFIX-LENGTH characters of the hash.
|
||||||
(let ((base (basename store-path)))
|
Otherwise return STORE-PATH."
|
||||||
(string-append (string-take base prefix-length)
|
(if (string-prefix? (%store-directory) store-path)
|
||||||
"…"
|
(let ((base (basename store-path)))
|
||||||
(string-drop base 32))))
|
(string-append (string-take base prefix-length)
|
||||||
|
"…"
|
||||||
|
(string-drop base 32)))
|
||||||
|
store-path))
|
||||||
|
|
||||||
(define* (progress-proc file size
|
(define* (progress-proc file size
|
||||||
#:optional (log-port (current-output-port))
|
#:optional (log-port (current-output-port))
|
||||||
|
|
Loading…
Reference in New Issue