diff --git a/collects/planet/planet.ss b/collects/planet/planet.ss index f0bf8640de..5942c9aefd 100644 --- a/collects/planet/planet.ss +++ b/collects/planet/planet.ss @@ -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))) diff --git a/collects/planet/util.ss b/collects/planet/util.ss index b4391d9e78..a7a9025065 100644 --- a/collects/planet/util.ss +++ b/collects/planet/util.ss @@ -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