raco setup: fix test for installing doc CSS to user-specific location

For example, if a package is installed in user scope where no
user-scope documentation is already built, CSS files need to be
in place for the main page of user-specific documentation.
This commit is contained in:
Matthew Flatt 2014-02-01 09:44:57 -07:00
parent 01a5dd2dbf
commit a6c28c2c06

View File

@ -263,11 +263,19 @@
(path->relative-string/setup p)) (path->relative-string/setup p))
(delete-directory/files p))))) (delete-directory/files p)))))
(define auto-main? (and auto-start-doc?
(or (ormap can-build*? main-docs)
(and tidy? (not avoid-main?)))))
(define auto-user? (and auto-start-doc?
(or (ormap can-build*? user-docs)
(and tidy? make-user?))))
(define (can-build**? doc) (can-build? only-dirs doc auto-main? auto-user?))
(unless latex-dest (unless latex-dest
;; Make sure "scribble.css", etc., is in place: ;; Make sure "scribble.css", etc., is in place:
(let ([ht (make-hash)]) (let ([ht (make-hash)])
(for ([doc (in-list docs)]) (for ([doc (in-list docs)])
(when (can-build? only-dirs doc) (when (can-build**? doc)
(check-shared-files (doc-dest-dir doc) (check-shared-files (doc-dest-dir doc)
(or (memq 'main-doc-root (doc-flags doc)) (or (memq 'main-doc-root (doc-flags doc))
(memq 'user-doc-root (doc-flags doc))) (memq 'user-doc-root (doc-flags doc)))
@ -275,13 +283,6 @@
ht ht
setup-printf))))) setup-printf)))))
(define auto-main? (and auto-start-doc?
(or (ormap can-build*? main-docs)
(and tidy? (not avoid-main?)))))
(define auto-user? (and auto-start-doc?
(or (ormap can-build*? user-docs)
(and tidy? make-user?))))
(define (can-build**? docs) (can-build? only-dirs docs auto-main? auto-user?))
(define force-out-of-date? #f) (define force-out-of-date? #f)
(define lock-ch #f) (define lock-ch #f)