Use case instead of cond

This commit is contained in:
Sam Tobin-Hochstadt 2013-08-30 10:14:38 +02:00
parent 101d441fe2
commit b69e909f13

View File

@ -425,11 +425,11 @@
#:pkg-name pkg-name)]))
(define (checksum-for-pkg-source pkg-source type pkg-name given-checksum download-printf)
(cond
[(or (eq? type 'file-url) (eq? type 'dir-url) (eq? type 'github))
(case type
[(file-url dir-url github)
(or (remote-package-checksum `(url ,pkg-source) download-printf pkg-name)
given-checksum)]
[(eq? type 'file)
[(file)
(define checksum-pth (format "~a.CHECKSUM" pkg-source))
(or (and (file-exists? checksum-pth)
(file->string checksum-pth))