Fixed a fragility in which drscheme might fail to start up

if no planet packages are installed

svn: r3542
This commit is contained in:
Jacob Matthews 2006-06-29 16:06:36 +00:00
parent ef8042997a
commit 0787328fe8
2 changed files with 11 additions and 6 deletions

View File

@ -5,7 +5,10 @@
;; get-planet-cache-path : -> path[absolute, file] ;; get-planet-cache-path : -> path[absolute, file]
;; the path to the cache.ss file for the planet installation ;; 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) (define (get-planet-cache-path)
(let ((path (build-path (PLANET-DIR) "cache.ss"))) (let ((path (build-path (PLANET-DIR) "cache.ss")))
path))) path)))

View File

@ -113,11 +113,13 @@
i i
f)])) f)]))
(let ([l (with-input-from-file f read)]) (let ([l (with-input-from-file f read)])
(unless (list? l) (cond
[(list? l) l]
[(eof-object? l) '()] ;; allow completely empty files
[else
(error 'find-relevant-directories (error 'find-relevant-directories
"bad info-domain cache file: ~a" "bad info-domain cache file: ~a"
f)) f)]))))))
l)))))
(reverse (table-paths t))) (reverse (table-paths t)))
;; For each coll, invert the mapping, adding the col name to the list for each sym: ;; For each coll, invert the mapping, adding the col name to the list for each sym:
(hash-table-for-each colls (hash-table-for-each colls