Added resolve-planet-path to util.ss

svn: r4265
This commit is contained in:
Jacob Matthews 2006-09-07 03:13:31 +00:00
parent ffb939b621
commit 5d37cb79e7
3 changed files with 19 additions and 2 deletions

View File

@ -196,6 +196,13 @@ first removes the old link and then adds the new one.
Removes any hard link that may be associated with the given package.
> (resolve-planet-path quoted-planet-require-spec) -> path
Returns the file system path to the file specified by the given quoted
planet require specification. This function downloads and installs the
specified package if necessary, but does not verify that the actual
file within it actually exists.
_The PLaneT search order_
-------------------------

View File

@ -160,6 +160,7 @@ an appropriate subdirectory.
"private/linkage.ss")
(provide (rename resolver planet-module-name-resolver)
resolve-planet-path
pkg-spec->full-pkg-spec
get-package-from-cache
get-package-from-server
@ -277,9 +278,16 @@ attempted to load version ~a.~a while version ~a.~a was already loaded"
; environment
(define (planet-resolve spec module-path stx load?)
(let-values ([(path pkg) (get-planet-module-path/pkg spec module-path stx)])
(add-pkg-to-diamond-registry! pkg)
(when load? (add-pkg-to-diamond-registry! pkg))
(do-require path (pkg-path pkg) module-path stx load?)))
;; resolve-planet-path : planet-require-spec -> path
;; retrieves the path to the given file in the planet package. downloads and installs
;; the package if necessary
(define (resolve-planet-path spec)
(let-values ([(path pkg) (get-planet-module-path/pkg spec #f #f)])
path))
;; get-planet-module-path/pkg :PLANET-REQUEST symbol syntax[PLANET-REQUEST] -> path PKG
;; returns the matching package and the file path to the specific request
(define (get-planet-module-path/pkg spec module-path stx)

View File

@ -23,7 +23,9 @@
get-installed-planet-archives
get-hard-linked-packages
remove-pkg
unlink-all)
unlink-all
resolve-planet-path)
(provide/contract
[download/install-pkg