pkg/lib: fix `get-pkg-content'

When discovering modules, handle the case that a directory
name doesn't work as a collection name.
This commit is contained in:
Matthew Flatt 2013-04-22 08:39:17 -06:00
parent 4cc320e49d
commit 1fa80c84e0

View File

@ -1712,11 +1712,13 @@
#:when (file-exists? f)
#:when (regexp-match? #rx#"[.](rkt|ss)$" (path->bytes f))
#:when (let-values ([(base name dir?) (split-path f)])
(not (eq? 'relative base))))
(define m (apply ~a
(not (eq? 'relative base)))
[m (in-value
(apply ~a
#:separator "/"
(map path-element->string
(explode-path f))))
(explode-path f))))]
#:when (module-path? `(lib ,m)))
;; normalize the path:
(collapse-module-path `(lib ,m) dummy)))))