raco setup: fix problem with docs

Support for "moving" pre-built docs into place did not handle
the case that the version number is wrong, which could happen
either because the pre-built version doesn't match or the docs
were built (in an old version) without a "synced.rktd" marker.
This commit is contained in:
Matthew Flatt 2013-06-16 06:28:26 -07:00
parent a89f28118c
commit a1f76598bb

View File

@ -963,6 +963,12 @@
#f)))) #f))))
(define (move-documentation-into-place doc src-dir setup-printf workerid lock) (define (move-documentation-into-place doc src-dir setup-printf workerid lock)
(with-handlers ([exn:fail? (lambda (exn)
;; On any failure, log the error and give up.
;; Maybe further actions are appropriate, but
;; overall clean-up and repair is intended to be
;; the job of the regular documentation builder.
(log-error (exn-message exn)))])
(define dest-dir (doc-dest-dir doc)) (define dest-dir (doc-dest-dir doc))
(define move? (not (equal? (file-or-directory-identity src-dir) (define move? (not (equal? (file-or-directory-identity src-dir)
(and (directory-exists? dest-dir) (and (directory-exists? dest-dir)
@ -1008,7 +1014,7 @@
;; with "provides.sxref" and ".html" files have been updated. ;; with "provides.sxref" and ".html" files have been updated.
(let ([provided-path (build-path dest-dir "synced.rktd")]) (let ([provided-path (build-path dest-dir "synced.rktd")])
(unless (file-exists? provided-path) (unless (file-exists? provided-path)
(call-with-output-file provided-path (lambda (o) (write '#t o)))))) (call-with-output-file provided-path (lambda (o) (write '#t o)))))))
(define (read-delayed-in! info latex-dest) (define (read-delayed-in! info latex-dest)
(let* ([doc (info-doc info)] (let* ([doc (info-doc info)]