/usr/share/racket/collects/raco/all-tools.rkt is in racket-common 6.1-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | #lang racket/base
(require setup/getinfo
racket/list)
(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)
(let* ([dirs (find-relevant-directories '(raco-commands) 'all-available)]
[tools (make-hash)])
(for ([i (in-list (filter-map get-info/full/skip dirs))]
[d (in-list dirs)])
(let ([entries (let ([l (if i
(i 'raco-commands (lambda () null))
null)])
(if (list? l)
l
(list l)))])
(for ([entry (in-list entries)])
(cond
[(and (list? entry)
(= (length entry) 4)
(string? (car entry))
(module-path? (cadr entry))
(string? (caddr entry))
(or (not (list-ref entry 3))
(real? (list-ref entry 3))))
(let ([p (hash-ref tools (car entry) #f)])
(when p
(eprintf
"warning: tool ~s registered twice: ~e and ~e\n"
(car entry)
(car p)
d)))
(let ([entry (let ([e (cadr entry)])
(if (or (string? e)
(and (pair? e)
(eq? (car e) 'file)
(relative-path? (cadr e))))
;; convert absolute path to realive to "info.rkt":
(list* (car entry)
(build-path d (if (pair? e)
(cadr e)
e))
(cddr entry))
;; module path is absolute already:
entry))])
(hash-set! tools (car entry) entry))]
[else
(eprintf "warning: ~s provided bad `raco-commands' spec: ~e\n"
d
entry)]))))
tools))
|