From 092db5414ab688a19290255df60466893fb78d3a Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Tue, 18 Jun 2013 17:13:06 -0600 Subject: [PATCH] fix for `find-relevant-directory-records' Multiple package-based instances of the same collection were not handled correctly. --- racket/lib/collects/setup/getinfo.rkt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/racket/lib/collects/setup/getinfo.rkt b/racket/lib/collects/setup/getinfo.rkt index 7ecc08bd05..1d19dd7b0f 100644 --- a/racket/lib/collects/setup/getinfo.rkt +++ b/racket/lib/collects/setup/getinfo.rkt @@ -101,9 +101,9 @@ (define (reset-relevant-directories-state!) (set! preferred-table (make-table - (lambda (i l) - (if (null? l) - (list i) + (lambda (root-dir i l) + (if (or root-dir (null? l)) + (cons i l) (match-let ([(struct directory-record (my-maj my-min _ _ _)) i] [(struct directory-record (their-maj their-min _ _ _)) (car l)]) @@ -112,9 +112,10 @@ (list i) l)))) #f #f)) - (set! all-available-table (make-table cons #f #f)) - (set! no-planet-table (make-table cons #f #f)) - (set! no-user-table (make-table cons #f #f))) + (define (always root-dir i l) (cons i l)) + (set! all-available-table (make-table always #f #f)) + (set! no-planet-table (make-table always #f #f)) + (set! no-user-table (make-table always #f #f))) (reset-relevant-directories-state!) @@ -166,7 +167,7 @@ (main-lib-relative->path pathbytes))) fields)]) (hash-set! colls key - ((table-insert t) new-item old-items)))] + ((table-insert t) root-dir new-item old-items)))] [_ (error 'find-relevant-directories "bad info-domain cache entry: ~e in: ~a" i f)]))))) ;; For each coll, invert the mapping, adding the col name to the list