raco: skip problem "info.rkt" files

Allows some `raco` tools to work (such as `raco pkg`) when loading
information about other installed tools fails, so that problems can
be more easily corrected using working tools (other than `raco setup`,
which is a special case, anyway, for bootstrapping).

Closes PR 14221

Merge to v6.0
This commit is contained in:
Matthew Flatt 2013-12-04 10:21:10 -07:00
parent dbad2913ec
commit b625e62ca8

View File

@ -1,12 +1,19 @@
#lang racket/base #lang racket/base
(require setup/getinfo
racket/list)
(require setup/getinfo)
(provide all-tools) (provide all-tools)
(define (get-info/full/skip dir)
(with-handlers ([exn:fail? (lambda (exn)
(log-error (exn-message exn))
#f)])
(get-info/full dir)))
(define (all-tools) (define (all-tools)
(let* ([dirs (find-relevant-directories '(raco-commands) 'all-available)] (let* ([dirs (find-relevant-directories '(raco-commands) 'all-available)]
[tools (make-hash)]) [tools (make-hash)])
(for ([i (in-list (map get-info/full dirs))] (for ([i (in-list (filter-map get-info/full/skip dirs))]
[d (in-list dirs)]) [d (in-list dirs)])
(let ([entries (let ([l (if i (let ([entries (let ([l (if i
(i 'raco-commands (lambda () null)) (i 'raco-commands (lambda () null))