fix relative references for license and acks in installer build

The process of creating an installer involves building "racket-index"
in user scope, but the license and acks files are normally only in
installation scope. An explicit targeting of the installation-scope
output needs to be disabled when the documentats are rendered to
user scope.

Closes #1635
This commit is contained in:
Matthew Flatt 2017-03-24 16:02:23 -06:00
parent a49bd5dc00
commit 8da0be8031

View File

@ -49,6 +49,7 @@
(define path (caddr info))
(define user-doc? (eq? installation-specific? #f))
(define inst-doc? (eq? installation-specific? #t))
(define as-plt-rel? (eq? root 'plt))
(define up-path
;; massage the current path to an up string
(regexp-replace* #rx"[^/]*/" (regexp-replace #rx"[^/]+$" path "") "../"))
@ -78,7 +79,7 @@
(map (lambda (item)
(let ([link-id (if (pair? item) (car item) item)])
((if (eq? id link-id) caddr cadr) item)))
(front-toc-items up-path)))
(front-toc-items up-path as-plt-rel?)))
(make-splice `(,page-title
,@toc
,@(if show-root-info?
@ -95,7 +96,7 @@
(module-path-index-join `(lib ,(format "scribblings/~a/~a.scrbl" s f))
#f))))
(define (front-toc-items up)
(define (front-toc-items up as-plt-rel?)
(map (lambda (item)
(if (eq? item '---)
(list '--- (make-toc-element #f null '(nbsp)))
@ -108,7 +109,15 @@
(define text (make-element "tocsubseclink" (list label)))
(define dest
(case root
[(plt) (build-path (find-doc-dir) path)]
[(plt) (if as-plt-rel?
;; Things that are normally installed in 'plt
;; should reference by relative paths other things
;; installed in 'plt, even if those things are together
;; installed in user space:
(string-append up path)
;; Otherwise, if we're installing a user space copy,
;; to this target as 'plt space:
(build-path (find-doc-dir) path))]
[(user) (string-append up path)]
[(#f) path]
[else (error "internal error (main-page)")]))