From 814ee99da89a0bcc6cf53d61763d345ed95e067c Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 3 Feb 2021 14:43:29 +0100 Subject: store: 'store-path-hash-part' really returns false for invalid file names. The "store-path-hash-part #f", due to a SRFI-64 bug, was marked as successful even though 'store-path-hash-part' was throwing an exception. * guix/store.scm (store-path-hash-part): Really return #f. --- guix/store.scm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/guix/store.scm b/guix/store.scm index e0b15abce3..81bb9eb847 100644 --- a/guix/store.scm +++ b/guix/store.scm @@ -2173,10 +2173,12 @@ valid inputs." (define (store-path-hash-part path) "Return the hash part of PATH as a base32 string, or #f if PATH is not a syntactically valid store path." - (let* ((base (store-path-base path)) - (hash (string-take base 32))) - (and (string-every %nix-base32-charset hash) - hash))) + (match (store-path-base path) + (#f #f) + (base + (let ((hash (string-take base 32))) + (and (string-every %nix-base32-charset hash) + hash))))) (define (derivation-log-file drv) "Return the build log file for DRV, a derivation file name, or #f if it -- cgit 1.4.1