From 332c863e784cace48828bfd5c8eb71bb1f59012f Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 8 May 2013 18:49:54 -0400 Subject: [PATCH] raco pkg: don't treat "info.rkt" as a conflict Even though "info.rkt" files are in collections, `raco setup' treats them in a directory-specific way --- and that's necessary for specifying things like `compile-omit-files' in a collection splice. --- collects/pkg/lib.rkt | 37 ++++++++++++------- collects/scribblings/main/private/manuals.rkt | 2 +- .../pkg/test-pkgs/pkg-test1/data/info.rkt | 3 ++ 3 files changed, 27 insertions(+), 15 deletions(-) create mode 100644 collects/tests/pkg/test-pkgs/pkg-test1/data/info.rkt diff --git a/collects/pkg/lib.rkt b/collects/pkg/lib.rkt index 9e2e24a171..72b6eb0fe5 100644 --- a/collects/pkg/lib.rkt +++ b/collects/pkg/lib.rkt @@ -1807,21 +1807,30 @@ (define-values (base name dir?) (split-path f)) (cond [(eq? 'relative base) s] - [(regexp-match? #rx#"[.](?:rkt|ss)$" (path-element->bytes name)) - (try-path s f)] - [(regexp-match? #rx#"_(?:rkt|ss)[.]zo$" (path-element->bytes name)) - (define-values (dir-base dir-name dir?) (split-path base)) + [else + (define bstr (path-element->bytes name)) (cond - [(eq? 'relative dir-base) s] - [(equal? dir-name compiled) - (try-path s (build-path dir-base - (bytes->path-element - (regexp-replace - #rx#"_(?:rkt|ss)[.]zo$" - (path-element->bytes name) - #".rkt"))))] - [else s])] - [else s])])))) + [(or (equal? #"info.rkt" bstr) + (equal? #"info.ss" bstr)) + ;; don't count "info.rkt" as a conflict, because + ;; splices may need their own "info.rkt"s, and + ;; `raco setup' can handle that + s] + [(regexp-match? #rx#"[.](?:rkt|ss)$" bstr) + (try-path s f)] + [(regexp-match? #rx#"_(?:rkt|ss)[.]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) + (try-path s (build-path dir-base + (bytes->path-element + (regexp-replace + #rx#"_(?:rkt|ss)[.]zo$" + (path-element->bytes name) + #".rkt"))))] + [else s])] + [else s])])])))) (define (pkg-catalog-update-local #:catalog-file [catalog-file (db:current-pkg-catalog-file)] #:quiet? [quiet? #f] diff --git a/collects/scribblings/main/private/manuals.rkt b/collects/scribblings/main/private/manuals.rkt index 192a26d227..3b7be2eeee 100644 --- a/collects/scribblings/main/private/manuals.rkt +++ b/collects/scribblings/main/private/manuals.rkt @@ -29,7 +29,7 @@ (if sep? (cons (mk-sep lbl) l) l))])))) (define (make-start-page all?) - (let* ([recs (find-relevant-directory-records '(scribblings))] + (let* ([recs (find-relevant-directory-records '(scribblings) 'all-available)] [infos (map get-info/full (map directory-record-path recs))] [main-dirs (parameterize ([current-library-collection-paths (list (find-collects-dir))]) diff --git a/collects/tests/pkg/test-pkgs/pkg-test1/data/info.rkt b/collects/tests/pkg/test-pkgs/pkg-test1/data/info.rkt new file mode 100644 index 0000000000..2320a222ba --- /dev/null +++ b/collects/tests/pkg/test-pkgs/pkg-test1/data/info.rkt @@ -0,0 +1,3 @@ +#lang setup/infotab + +(define name "Also Data")