Track checksum errors

This commit is contained in:
Jay McCarthy 2013-09-12 10:55:14 -06:00
parent 28d0ec6d4d
commit dbed9740e5

View File

@ -247,6 +247,8 @@
(member author (author->list (package-ref info 'author)))]
[":no-tag:"
(empty? (package-ref info 'tags))]
[":error:"
(hash-ref info 'checksum-error #f)]
[(regexp #rx"^!(.*?)$" (list _ sub))
(not (search-term-eval pkg-name info sub))]
[_
@ -348,7 +350,9 @@
,t)
" "))
(a ([href ,(main-url page/search (snoc terms ":no-tag:"))])
":no-tag:")))
":no-tag:")
(a ([href ,(main-url page/search (snoc terms ":error:"))])
":error:")))
(define (page/search req terms)
(define pkgs (package-list/search terms))
@ -810,6 +814,11 @@
(tr
(td "Checksum")
(td ,(package-ref* i 'checksum "")))
,@(if (package-ref* i 'checksum-error #f)
`(tr (td "Error")
(td "The last time we attempted to update this checksum. The following error was thrown:"
(pre ,(package-ref* i 'checksum-error ""))))
empty)
(tr
(td "Last Update")
(td ,(format-time (package-ref* i 'last-updated #f))))
@ -895,6 +904,13 @@
(for-each (curry update-checksum force?) pkgs))
(define (update-checksum force? pkg-name)
(with-handlers
([exn:fail?
(λ (x)
(define i (package-info pkg-name))
(package-info-set!
pkg-name
(hash-set i 'checksum-error (exn-message x))))])
(define i (package-info pkg-name))
(define old-checksum
(package-ref i 'checksum))
@ -932,7 +948,9 @@
(hash-ref i 'modules #f))
i
(hash-set (update-from-content i) 'last-updated now)))
(package-info-set! pkg-name i))))
(define* i
(hash-set i 'checksum-error #f))
(package-info-set! pkg-name i)))))
(define (update-from-content i)
(define-values (checksum module-paths dependencies)