fixed a bug in help desk resetting of the cache

svn: r5112
This commit is contained in:
Robby Findler 2006-12-14 00:17:54 +00:00
parent b728c01fee
commit 57524d3b8c
3 changed files with 28 additions and 16 deletions

View File

@ -3,6 +3,7 @@
"colldocs.ss"
"path.ss"
"manuals.ss"
(lib "getinfo.ss" "setup")
(lib "list.ss")
(lib "plt-match.ss")
(lib "contract.ss")
@ -287,6 +288,8 @@
(string->list s)))))
(define (doc-collections-changed)
(reset-relevant-directories-state!)
(reset-doc-lists)
(set! doc-collection-dates (map (lambda (x) #f) doc-dirs))
(set! html-keywords (make-hash-table 'equal))
(set! html-indices (make-hash-table 'equal))

View File

@ -435,6 +435,10 @@ The _getinfo.ss_ module defines the following procedures:
same name, find-relevant-directories will only search the one that
occurs first in the PLT_COLLECTION_PATHS environment variable.
> (reset-relevant-directories-state!)
Resets the cache used by `find-relevant-directories'.
_.plt_ Archive Internals
==========================================================

View File

@ -50,23 +50,27 @@
paths ; listof path
))
(define preferred-table
(make-table
(lambda (i l)
(cond
[(null? l)
(list i)]
[else
(match-let ([(_ _ my-maj my-min) i]
[(_ _ their-maj their-min) (car l)])
(if
(or (> my-maj their-maj)
(and (= my-maj their-maj) (>= my-min their-min)))
(list i)
l))]))
#f #f))
(define preferred-table #f)
(define all-available-table #f)
(define all-available-table (make-table cons #f #f))
(define (reset-relevant-directories-state!)
(set! preferred-table
(make-table
(lambda (i l)
(cond
[(null? l)
(list i)]
[else
(match-let ([(_ _ my-maj my-min) i]
[(_ _ their-maj their-min) (car l)])
(if
(or (> my-maj their-maj)
(and (= my-maj their-maj) (>= my-min their-min)))
(list i)
l))]))
#f #f))
(set! all-available-table (make-table cons #f #f)))
(reset-relevant-directories-state!)
(define (populate-table! t)
;; Use the colls ht because a collection might be in multiple
@ -175,6 +179,7 @@
[else (path->bytes name)])))
(provide/contract
(reset-relevant-directories-state! (-> any))
(get-info ((listof path-or-string?) . -> . (or/c info? boolean?)))
(get-info/full (path? . -> . (or/c info? boolean?)))
(find-relevant-directories (opt-> ((listof symbol?))