From 82b9a9f4ddcac2ae61b735e3fb0abbbc25842153 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Tue, 3 Nov 2009 17:36:45 +0000 Subject: [PATCH] allow environment variable-based spec of the url to download planet packages from svn: r16521 --- collects/planet/config.ss | 15 +++++++++------ collects/planet/planet.scrbl | 6 ++++-- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/collects/planet/config.ss b/collects/planet/config.ss index 77d3592e86..a79016fec5 100644 --- a/collects/planet/config.ss +++ b/collects/planet/config.ss @@ -4,11 +4,12 @@ (PLANET-SERVER-NAME "planet.plt-scheme.org") (PLANET-SERVER-PORT 270) (PLANET-CODE-VERSION "300") - (PLANET-BASE-DIR (if (getenv "PLTPLANETDIR") - (string->path (getenv "PLTPLANETDIR")) - (build-path (find-system-path 'addon-dir) - "planet" - (PLANET-CODE-VERSION)))) + (PLANET-BASE-DIR (let ([plt-planet-dir-env-var (getenv "PLTPLANETDIR")]) + (if plt-planet-dir-env-var + (string->path plt-planet-dir-env-var) + (build-path (find-system-path 'addon-dir) + "planet" + (PLANET-CODE-VERSION))))) (PLANET-DIR (build-path (PLANET-BASE-DIR) (version))) (CACHE-DIR (build-path (PLANET-DIR) "cache")) (UNINSTALLED-PACKAGE-CACHE (build-path (PLANET-BASE-DIR) "packages")) @@ -19,6 +20,8 @@ (DEFAULT-PACKAGE-LANGUAGE (version)) (USE-HTTP-DOWNLOADS? #t) - (HTTP-DOWNLOAD-SERVLET-URL "http://planet.plt-scheme.org/servlets/planet-servlet.ss") + (HTTP-DOWNLOAD-SERVLET-URL (let ([plt-planet-url-env-var (getenv "PLTPLANETURL")]) + (or plt-planet-url-env-var + "http://planet.plt-scheme.org/servlets/planet-servlet.ss"))) (PLANET-ARCHIVE-FILTER #f))) diff --git a/collects/planet/planet.scrbl b/collects/planet/planet.scrbl index d3922f4f5b..b134c2c96f 100644 --- a/collects/planet/planet.scrbl +++ b/collects/planet/planet.scrbl @@ -518,8 +518,10 @@ this parameter to @scheme[#f] is not recommended.} @defparam[HTTP-DOWNLOAD-SERVLET-URL url string?]{ The URL for the servlet that will provide PLaneT packages if -@scheme[USE-HTTP-DOWNLOADS?] is @scheme[#t], represented as a string. The default -value is @scheme["http://planet.plt-scheme.org/servlets/planet-servlet.ss"].} +@scheme[USE-HTTP-DOWNLOADS?] is @scheme[#t], represented as a string. +This defaults to the value of the @indexed-envvar{PLTPLANETURL} environment +variable if it is set and otherwise is +@scheme["http://planet.plt-scheme.org/servlets/planet-servlet.ss"].} @defparam[PLANET-SERVER-NAME host string?]{ The name of the PLaneT server to which the client should connect if