From 47a0a4e250572ef92ee0e855a2b420185e5ba023 Mon Sep 17 00:00:00 2001 From: sorawee Date: Fri, 21 Feb 2020 22:18:29 -0500 Subject: [PATCH] Allow installation from locally cloned git repo (#58) pkg-info might contain a #f checksum, causing substring to raise a contract error. This commit avoids the error. --- quad/quad/checksum.rkt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/quad/quad/checksum.rkt b/quad/quad/checksum.rkt index dd1510b3..5454d960 100644 --- a/quad/quad/checksum.rkt +++ b/quad/quad/checksum.rkt @@ -4,6 +4,6 @@ (define (pkg-checksum [pkg "quad"] #:short [short? #false]) (match (for/or ([scope (in-list '(user installation shared))]) - (hash-ref (read-pkgs-db scope) pkg #false)) - [(pkg-info _ checksum _) (if short? (substring checksum 0 7) checksum)] - [_ "checksum not found"])) \ No newline at end of file + (hash-ref (read-pkgs-db scope) pkg #false)) + [(pkg-info _ (? string? checksum) _) (if short? (substring checksum 0 7) checksum)] + [_ "checksum not found"]))