guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: guix-commits
Subject: 02/05: packages: <content-hash> printer gracefully handle #f values.
Date: Mon, 31 Aug 2020 09:51:17 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 83ec969cc7170634872d4ff3ffc0d4099a6765a4
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Mon Aug 31 12:24:21 2020 +0200

    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'.
---
 guix/packages.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/guix/packages.scm b/guix/packages.scm
index 95d7c2c..6598bd3 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -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)
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]