changed planet search order, now uninstalled packages are only consulted if an attempt to download from the network fails.

svn: r5638
This commit is contained in:
Jacob Matthews 2007-02-19 23:30:37 +00:00
parent c2e4fcd60d
commit 844ed2d48f
2 changed files with 26 additions and 8 deletions

View File

@ -80,8 +80,10 @@ cache, which contains compiled files and is specific to each
particular version of PLT Scheme, the uninstalled package cache is
shared by all versions of PLT Scheme that use the same package
repository, and it is searched if a package is not installed in the
primary cache. This behavior is intended to primarily benefit users
who upgrade their PLT Scheme installations frequently.
primary cache and cannot be downloaded from the central PLaneT repository
(for instance due to a loss of Internet connectivity). This behavior
is intended to primarily benefit users who upgrade their PLT Scheme
installations frequently.
> (LINKAGE-FILE) file-string
> (LINKAGE-FILE file-string) -> void
@ -235,6 +237,18 @@ the requirement. The server then finds the newest matching package
and sends it back to the client, which then installs it and uses
it to satisfy the original requirement.
4. Cached installation archive
If the remote server cannot be contacted (or fails in any way to
deliver an acceptable package), the PLaneT client consults the
uninstalled-packages cache, a cache of all previously-downloaded
packages, even those that are not currently installed. PLT Scheme
users who frequently upgrade their installations may have many
packages downloaded but not installed at any given time; this step
is intended to ensure that these users can still run programs even
if they temporarily lose network connection.
_The planet command-line tool_
------------------------------

View File

@ -410,6 +410,12 @@ attempted to load version ~a.~a while version ~a.~a was already loaded"
(define (get-package-from-cache pkg-spec)
(lookup-package pkg-spec))
;; get/uninstalled-cache-dummy : pkg-getter
;; always fails, but records the package to the uninstalled package cache
;; upon the success of some other getter later in the chain.
(define (get/uninstalled-cache-dummy module-spec pkg-spec success-k failure-k)
(failure-k save-to-uninstalled-pkg-cache! void (λ (x) x)))
; get/uninstalled-cache : pkg-getter
; note: this does not yet work with minimum-required-version specifiers
; if you install a package and then use an older mzscheme
@ -426,10 +432,7 @@ attempted to load version ~a.~a while version ~a.~a was already loaded"
pkg-spec
(pkg-maj p)
(pkg-min p)))
(failure-k
save-to-uninstalled-pkg-cache!
void
(λ (x) x)))))
(failure-k void void (λ (x) x)))))
;; save-to-uninstalled-pkg-cache! : uninstalled-pkg -> path[file]
;; copies the given uninstalled package into the uninstalled-package cache,
@ -714,8 +717,9 @@ attempted to load version ~a.~a while version ~a.~a was already loaded"
(list
get/linkage
get/installed-cache
get/uninstalled-cache
get/server)))
get/uninstalled-cache-dummy
get/server
get/uninstalled-cache)))
; ============================================================