From 8da0be8031ce4abff8867b83f375aafaaa88cd54 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Fri, 24 Mar 2017 16:02:23 -0600 Subject: [PATCH] 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 --- .../scribblings/main/private/utils.rkt | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pkgs/racket-index/scribblings/main/private/utils.rkt b/pkgs/racket-index/scribblings/main/private/utils.rkt index dda8bbf597..7e4be8d39c 100644 --- a/pkgs/racket-index/scribblings/main/private/utils.rkt +++ b/pkgs/racket-index/scribblings/main/private/utils.rkt @@ -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)")]))