From 937588f5528c86ee990df8d8ed53cf9ac4941f6b Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Thu, 18 Jul 2013 15:06:19 -0600 Subject: [PATCH] count ".scrbl" files as modules within a package The set of relevant extensions should be made extensible, eventually. --- racket/lib/collects/pkg/lib.rkt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/racket/lib/collects/pkg/lib.rkt b/racket/lib/collects/pkg/lib.rkt index c4e9ab8cc4..29493677df 100644 --- a/racket/lib/collects/pkg/lib.rkt +++ b/racket/lib/collects/pkg/lib.rkt @@ -2098,7 +2098,9 @@ (loop s f check-zo?))] [(directory-exists? f) ;; Count ".zo" files toward the set of module paths only - ;; if an "info.rkt" in an + ;; if an "info.rkt" in an enclosing directory says to + ;; assume virtual sources. Otherwise, the ".zo" file will + ;; be discarded by `raco setup'. (define sub-check-zo? (or check-zo? (let ([i (get-pkg-info f metadata-ns)]) @@ -2120,16 +2122,16 @@ ;; splices may need their own "info.rkt"s, and ;; `raco setup' can handle that s] - [(regexp-match? #rx#"[.](?:rkt|ss)$" bstr) + [(regexp-match? #rx#"[.](?:rkt|ss|scrbl)$" bstr) (try-path s f)] [(and check-zo? - (regexp-match? #rx#"_(?:rkt|ss)[.]zo$" (path-element->bytes name))) + (regexp-match? #rx#"_(?:rkt|ss|scrbl)[.]zo$" (path-element->bytes name))) (define-values (dir-base dir-name dir?) (split-path base)) (cond [(eq? 'relative dir-base) s] [(equal? dir-name compiled) (define bstr2 (regexp-replace - #rx#"_(?:rkt|ss)[.]zo$" + #rx#"_(?:rkt|ss|scrbl)[.]zo$" (path-element->bytes name) #".rkt")) (if (equal? #"info.rkt" bstr2)