packages: <content-hash> printer gracefully handle #f values.

Suggested by Robin Green <greenrd@greenrd.org>.

* guix/packages.scm (print-content-hash): Gracefully deal with cases
with 'content-hash-value' returns #f, as is the case for 'linux-libre'.
This commit is contained in:
Ludovic Courtès 2020-08-31 12:24:21 +02:00
parent b03267df6d
commit 83ec969cc7
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 2 additions and 1 deletions

View File

@ -228,7 +228,8 @@ as base32. Otherwise, it must be a bytevector."
(define (print-content-hash hash port)
(format port "#<content-hash ~a:~a>"
(content-hash-algorithm hash)
(bytevector->nix-base32-string (content-hash-value hash))))
(and=> (content-hash-value hash)
bytevector->nix-base32-string)))
(set-record-type-printer! <content-hash> print-content-hash)