From 5eee14032fa147c6759c0a50af8b460c9bd84dc1 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Thu, 3 Oct 2013 10:00:33 -0600 Subject: [PATCH] raco setup et al.: fix problem with relative paths that exit a collection Closes PR 14063 --- pkgs/racket-pkgs/racket-test/tests/racket/setup.rktl | 7 ++++++- racket/collects/setup/collects.rkt | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pkgs/racket-pkgs/racket-test/tests/racket/setup.rktl b/pkgs/racket-pkgs/racket-test/tests/racket/setup.rktl index fe88337d38..a3ca705ffb 100644 --- a/pkgs/racket-pkgs/racket-test/tests/racket/setup.rktl +++ b/pkgs/racket-pkgs/racket-test/tests/racket/setup.rktl @@ -29,7 +29,12 @@ (for ([i '([("main.rkt" "racket") (lib "racket/main.rkt")] [("reader.rkt" "scribble") (lib "scribble/reader.rkt")])]) - (test (cadr i) path->module-path (apply collection-file-path (car i)))) + (define p (apply collection-file-path (car i))) + (test (cadr i) path->module-path p) + (let ([out (build-path (let-values ([(base name dir?) (split-path p)]) + base) + "../info.rkt")]) + (test (simplify-path out) path->module-path out))) (test "a/b" path->module-path "a/b") (test (find-system-path 'temp-dir) path->module-path (find-system-path 'temp-dir)) diff --git a/racket/collects/setup/collects.rkt b/racket/collects/setup/collects.rkt index 4206e2e500..0c4334853c 100644 --- a/racket/collects/setup/collects.rkt +++ b/racket/collects/setup/collects.rkt @@ -27,8 +27,9 @@ (if pkg-collect (cons pkg-collect l) l))) - (define c-p (apply collection-file-path (car p-l) new-c-l - #:fail (lambda (msg) #f))) + (define c-p (and (pair? (cdr p-l)) + (apply collection-file-path (car p-l) new-c-l + #:fail (lambda (msg) #f)))) (and c-p (equal? c-p simple-p) (make-result new-c-l (car p-l)))]