Explicitly enabling download? and install? on user initiated installs
Forgot to commit earlier :(
This commit is contained in:
parent
60ae164d05
commit
c980182b6b
|
@ -12,6 +12,7 @@ PLANNED FEATURES:
|
||||||
racket/match
|
racket/match
|
||||||
raco/command-name
|
raco/command-name
|
||||||
|
|
||||||
|
(only-in planet/resolver download?)
|
||||||
planet/config
|
planet/config
|
||||||
planet/private/planet-shared
|
planet/private/planet-shared
|
||||||
planet/util
|
planet/util
|
||||||
|
@ -160,17 +161,18 @@ This command does not unpack or install the named .plt file."
|
||||||
(fail "Could not find matching package")))))
|
(fail "Could not find matching package")))))
|
||||||
|
|
||||||
(define (download/no-install owner pkg majstr minstr)
|
(define (download/no-install owner pkg majstr minstr)
|
||||||
(let* ([maj (read-from-string majstr)]
|
(parameterize ([download? #t])
|
||||||
[min (read-from-string minstr)]
|
(let* ([maj (read-from-string majstr)]
|
||||||
[full-pkg-spec (get-package-spec owner pkg maj min)])
|
[min (read-from-string minstr)]
|
||||||
(when (file-exists? pkg)
|
[full-pkg-spec (get-package-spec owner pkg maj min)])
|
||||||
(fail "Cannot download, there is a file named ~a in the way" pkg))
|
(when (file-exists? pkg)
|
||||||
(match (download-package full-pkg-spec)
|
(fail "Cannot download, there is a file named ~a in the way" pkg))
|
||||||
[(list #t path maj min)
|
(match (download-package full-pkg-spec)
|
||||||
(copy-file path pkg)
|
[(list #t path maj min)
|
||||||
(printf "Downloaded ~a package version ~a.~a\n" pkg maj min)]
|
(copy-file path pkg)
|
||||||
[_
|
(printf "Downloaded ~a package version ~a.~a\n" pkg maj min)]
|
||||||
(fail "Could not find matching package")])))
|
[_
|
||||||
|
(fail "Could not find matching package")]))))
|
||||||
|
|
||||||
;; params->full-pkg-spec : string string string string -> pkg
|
;; params->full-pkg-spec : string string string string -> pkg
|
||||||
;; gets a full package specifier for the given specification
|
;; gets a full package specifier for the given specification
|
||||||
|
|
|
@ -90,12 +90,14 @@
|
||||||
|
|
||||||
;; download/install-pkg : string string nat nat -> pkg | #f
|
;; download/install-pkg : string string nat nat -> pkg | #f
|
||||||
(define (download/install-pkg owner name maj min)
|
(define (download/install-pkg owner name maj min)
|
||||||
(let* ([pspec (pkg-spec->full-pkg-spec (list owner name maj min) #f)]
|
(parameterize ([install? #t]
|
||||||
[upkg (get-package-from-server pspec)])
|
[download? #t])
|
||||||
(cond
|
(let* ([pspec (pkg-spec->full-pkg-spec (list owner name maj min) #f)]
|
||||||
[(uninstalled-pkg? upkg)
|
[upkg (get-package-from-server pspec)])
|
||||||
(pkg-promise->pkg upkg)]
|
(cond
|
||||||
[else #f])))
|
[(uninstalled-pkg? upkg)
|
||||||
|
(pkg-promise->pkg upkg)]
|
||||||
|
[else #f]))))
|
||||||
|
|
||||||
;; current-cache-contents : -> ((string ((string ((nat (nat ...)) ...)) ...)) ...)
|
;; current-cache-contents : -> ((string ((string ((nat (nat ...)) ...)) ...)) ...)
|
||||||
;; returns the packages installed in the local PLaneT cache
|
;; returns the packages installed in the local PLaneT cache
|
||||||
|
|
Loading…
Reference in New Issue
Block a user