raco setup et al.: fix problem with relative paths that exit a collection

Closes PR 14063
This commit is contained in:
Matthew Flatt 2013-10-03 10:00:33 -06:00
parent a13aed7420
commit 5eee14032f
2 changed files with 9 additions and 3 deletions

View File

@ -29,7 +29,12 @@
(for ([i '([("main.rkt" "racket") (lib "racket/main.rkt")] (for ([i '([("main.rkt" "racket") (lib "racket/main.rkt")]
[("reader.rkt" "scribble") (lib "scribble/reader.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 "a/b" path->module-path "a/b")
(test (find-system-path 'temp-dir) path->module-path (find-system-path 'temp-dir)) (test (find-system-path 'temp-dir) path->module-path (find-system-path 'temp-dir))

View File

@ -27,8 +27,9 @@
(if pkg-collect (if pkg-collect
(cons pkg-collect l) (cons pkg-collect l)
l))) l)))
(define c-p (apply collection-file-path (car p-l) new-c-l (define c-p (and (pair? (cdr p-l))
#:fail (lambda (msg) #f))) (apply collection-file-path (car p-l) new-c-l
#:fail (lambda (msg) #f))))
(and c-p (and c-p
(equal? c-p simple-p) (equal? c-p simple-p)
(make-result new-c-l (car p-l)))] (make-result new-c-l (car p-l)))]