pkg/lib: add `pkg-directory->module-paths'

This commit is contained in:
Matthew Flatt 2013-08-15 14:19:55 -06:00
parent 21bba8a10b
commit 6035db418f
2 changed files with 18 additions and 1 deletions

View File

@ -405,3 +405,12 @@ If @racket[filter?] is true, then platform-specific dependencies are
removed from the result list when they do not apply to the current
platform, and other information is stripped so that the result list is
always a list of strings.}
@defproc[(pkg-directory->module-paths [dir path-string?]
[pkg-name string]
[#:namespace namespace namespace? (make-base-namespace)])
(listof module-path?)]{
Returns a list of module paths (normalized in the sense of
@racket[collapse-module-path]) that are provided by the package
represented by @racket[dir] and named @racket[pkg-name].}

View File

@ -2300,6 +2300,10 @@
(when clean?
(delete-directory/files dir))))
(define (pkg-directory->module-paths dir pkg-name
#:namespace [metadata-ns (make-metadata-namespace)])
(set->list (directory->module-paths dir pkg-name metadata-ns)))
(define (directory->module-paths dir pkg-name metadata-ns)
(define dummy (build-path dir "dummy.rkt"))
(define compiled (string->path-element "compiled"))
@ -2595,4 +2599,8 @@
(or/c #f string?))]
[find-pkg-installation-scope (->* (string?)
(#:next? boolean?)
(or/c #f package-scope/c))]))
(or/c #f package-scope/c))]
[pkg-directory->module-paths (->* (path-string? string?)
(#:namespace namespace?)
(listof module-path?))]))