301.15: new install tree for Unix, moved docs, moved teachpacks, added config.ss
svn: r2962 original commit: c727afef0444e8a583c63f17fe6b993b983ba00c
This commit is contained in:
parent
bd5562bcab
commit
63a69a4844
|
@ -5,7 +5,8 @@
|
||||||
"manuals.ss"
|
"manuals.ss"
|
||||||
(lib "list.ss")
|
(lib "list.ss")
|
||||||
(lib "plt-match.ss")
|
(lib "plt-match.ss")
|
||||||
(lib "contract.ss"))
|
(lib "contract.ss")
|
||||||
|
(lib "dirs.ss" "setup"))
|
||||||
|
|
||||||
(provide doc-collections-changed)
|
(provide doc-collections-changed)
|
||||||
(provide/contract
|
(provide/contract
|
||||||
|
@ -33,6 +34,7 @@
|
||||||
|
|
||||||
(non-regexp (string? . -> . string?)))
|
(non-regexp (string? . -> . string?)))
|
||||||
|
|
||||||
|
(define doc-dirs (get-doc-search-dirs))
|
||||||
|
|
||||||
; These are set by reset-doc-lists:
|
; These are set by reset-doc-lists:
|
||||||
; docs, doc-names and doc-kinds are parallel lists. doc-kinds
|
; docs, doc-names and doc-kinds are parallel lists. doc-kinds
|
||||||
|
@ -44,8 +46,12 @@
|
||||||
; doc-kinds : (list-of symbol)
|
; doc-kinds : (list-of symbol)
|
||||||
(define doc-kinds null)
|
(define doc-kinds null)
|
||||||
; doc-collection-date : (union #f number 'none)
|
; doc-collection-date : (union #f number 'none)
|
||||||
(define doc-collection-date #f)
|
(define doc-collection-dates (map (lambda (x) #f) doc-dirs))
|
||||||
|
|
||||||
|
(define (dir-date/none dir)
|
||||||
|
(with-handlers ([exn:fail:filesystem? (lambda (x) 'none)])
|
||||||
|
(file-or-directory-modify-seconds dir)))
|
||||||
|
|
||||||
(define (reset-doc-lists)
|
(define (reset-doc-lists)
|
||||||
; Locate standard HTML documentation
|
; Locate standard HTML documentation
|
||||||
(define-values (std-docs std-doc-names)
|
(define-values (std-docs std-doc-names)
|
||||||
|
@ -64,10 +70,7 @@
|
||||||
txt-doc-names)))
|
txt-doc-names)))
|
||||||
(set! doc-kinds (append (map (lambda (x) 'html) std-docs) (map (lambda (x) 'text) txt-docs)))
|
(set! doc-kinds (append (map (lambda (x) 'html) std-docs) (map (lambda (x) 'text) txt-docs)))
|
||||||
|
|
||||||
(with-handlers ([exn:fail:filesystem? (lambda (x) (set! doc-collection-date 'none))])
|
(set! doc-collection-dates (map dir-date/none doc-dirs)))
|
||||||
(set! doc-collection-date
|
|
||||||
(file-or-directory-modify-seconds
|
|
||||||
(collection-path "doc")))))
|
|
||||||
|
|
||||||
(define MAX-HIT-COUNT 300)
|
(define MAX-HIT-COUNT 300)
|
||||||
|
|
||||||
|
@ -284,7 +287,7 @@
|
||||||
(string->list s)))))
|
(string->list s)))))
|
||||||
|
|
||||||
(define (doc-collections-changed)
|
(define (doc-collections-changed)
|
||||||
(set! doc-collection-date #f)
|
(set! doc-collection-dates (map (lambda (x) #f) doc-dirs))
|
||||||
(set! html-keywords (make-hash-table 'equal))
|
(set! html-keywords (make-hash-table 'equal))
|
||||||
(set! html-indices (make-hash-table 'equal))
|
(set! html-indices (make-hash-table 'equal))
|
||||||
(set! text-keywords (make-hash-table 'equal))
|
(set! text-keywords (make-hash-table 'equal))
|
||||||
|
@ -325,11 +328,18 @@
|
||||||
add-doc-section add-kind-section add-choice)
|
add-doc-section add-kind-section add-choice)
|
||||||
; When new docs are installed, the directory's modification date changes:
|
; When new docs are installed, the directory's modification date changes:
|
||||||
(set! max-reached #f)
|
(set! max-reached #f)
|
||||||
(unless (eq? doc-collection-date 'none)
|
|
||||||
(when (or (not doc-collection-date)
|
(when (ormap (lambda (date new-date)
|
||||||
(> (file-or-directory-modify-seconds (collection-path "doc"))
|
(cond
|
||||||
doc-collection-date))
|
[(not date) #t]
|
||||||
(reset-doc-lists)))
|
[(equal? date new-date) #f]
|
||||||
|
[(eq? date 'none) #t]
|
||||||
|
[(eq? new-date 'none) #t]
|
||||||
|
[else (new-date . > . date)]))
|
||||||
|
doc-collection-dates
|
||||||
|
(map dir-date/none doc-dirs))
|
||||||
|
(reset-doc-lists))
|
||||||
|
|
||||||
(let ([hit-count 0])
|
(let ([hit-count 0])
|
||||||
(let-values ([(string-finds finds) (build-string-finds/finds given-find regexp? exact?)]
|
(let-values ([(string-finds finds) (build-string-finds/finds given-find regexp? exact?)]
|
||||||
[(filtered-docs filtered-doc-names filtered-doc-kinds)
|
[(filtered-docs filtered-doc-names filtered-doc-kinds)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user