You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
9 lines
366 B
Racket
9 lines
366 B
Racket
#lang racket/base
|
|
(require racket/match pkg/path)
|
|
(provide pkg-checksum)
|
|
|
|
(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"])) |