#lang scheme
(require setup/dirs
scheme/fasl)
(for-each (lambda (doc)
(printf " Checking ~a info...\n" doc)
(let ([in (build-path (find-doc-dir) doc "out.sxref")]
[dest (format "~a.info" doc)])
(when ((file-or-directory-modify-seconds in #f (lambda () +inf.0))
. > .
(file-or-directory-modify-seconds dest #f (lambda () -inf.0)))
(let ([v (cadr (call-with-input-file* in fasl->s-exp))])
(printf " updating\n")
(with-output-to-file dest
#:exists 'truncate/replace
(lambda ()
(printf "~s\n" v)))))))
'("reference" "scribble" "htdp-langs"))