From 0787328fe875bd121217c2574c3b2a584cbe15f7 Mon Sep 17 00:00:00 2001 From: Jacob Matthews Date: Thu, 29 Jun 2006 16:06:36 +0000 Subject: [PATCH] Fixed a fragility in which drscheme might fail to start up if no planet packages are installed svn: r3542 --- collects/planet/cachepath.ss | 5 ++++- collects/setup/getinfo.ss | 12 +++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/collects/planet/cachepath.ss b/collects/planet/cachepath.ss index 46739853c4..38b39a6e23 100644 --- a/collects/planet/cachepath.ss +++ b/collects/planet/cachepath.ss @@ -5,7 +5,10 @@ ;; get-planet-cache-path : -> path[absolute, file] ;; the path to the cache.ss file for the planet installation - ;; SIDE EFFECT: creates the directory if it doesn't already exist + ;; (n.b. this used to have the side effect of creating the path + ;; if it didn't exist, but since this function may be run at + ;; setup time and setup-time programs must not create this sort + ;; of directory, it doesn't do that anymore) (define (get-planet-cache-path) (let ((path (build-path (PLANET-DIR) "cache.ss"))) path))) \ No newline at end of file diff --git a/collects/setup/getinfo.ss b/collects/setup/getinfo.ss index cf7ad22a46..23b2b3c974 100644 --- a/collects/setup/getinfo.ss +++ b/collects/setup/getinfo.ss @@ -113,11 +113,13 @@ i f)])) (let ([l (with-input-from-file f read)]) - (unless (list? l) - (error 'find-relevant-directories - "bad info-domain cache file: ~a" - f)) - l))))) + (cond + [(list? l) l] + [(eof-object? l) '()] ;; allow completely empty files + [else + (error 'find-relevant-directories + "bad info-domain cache file: ~a" + f)])))))) (reverse (table-paths t))) ;; For each coll, invert the mapping, adding the col name to the list for each sym: (hash-table-for-each colls