svn: r9571
This commit is contained in:
Jacob Matthews 2008-05-01 19:42:44 +00:00
parent 4ee005d004
commit 1fd8c3d892
2 changed files with 7 additions and 6 deletions

View File

@ -15,7 +15,6 @@ PLANNED FEATURES:
"config.ss"
"private/planet-shared.ss"
"private/command.ss"
"resolver.ss" ;; the code I need should be pulled out into a common library
"util.ss")
(define erase? (make-parameter #f))
@ -126,7 +125,7 @@ This command does not unpack or install the named .plt file."
(define (download/install owner name majstr minstr)
(let* ([maj (read-from-string majstr)]
[min (read-from-string minstr)]
[full-pkg-spec (pkg-spec->full-pkg-spec (list owner name maj min) #f)])
[full-pkg-spec (get-package-spec owner name maj min)])
(when (get-package-from-cache full-pkg-spec)
(fail "No package installed (cache already contains a matching package)"))
(unless (download/install-pkg owner name maj min)
@ -135,7 +134,7 @@ This command does not unpack or install the named .plt file."
(define (download/no-install owner pkg majstr minstr)
(let* ([maj (read-from-string majstr)]
[min (read-from-string minstr)]
[full-pkg-spec (pkg-spec->full-pkg-spec (list owner pkg maj min) #f)])
[full-pkg-spec (get-package-spec owner pkg maj min)])
(when (file-exists? pkg)
(fail "Cannot download, there is a file named ~a in the way" pkg))
(match (download-package full-pkg-spec)
@ -152,8 +151,7 @@ This command does not unpack or install the named .plt file."
(min (string->number minstr)))
(unless (and (integer? maj) (integer? min) (> maj 0) (>= min 0))
(fail "Invalid major/minor version"))
(let* ([spec (list ownerstr pkgstr maj min)]
[fullspec (pkg-spec->full-pkg-spec spec #f)])
(let* ([fullspec (get-package-spec ownerstr pkgstr maj min)])
(unless fullspec (fail "invalid spec: ~a" fullspec))
fullspec)))

View File

@ -41,7 +41,10 @@
resolve-planet-path
(struct-out exn:fail:planet)
display-plt-file-structure
display-plt-archived-file)
display-plt-archived-file
get-package-from-cache
install-pkg
pkg->download-url)
(provide/contract
[get-package-spec