Make zo-path checking available as a library.
This commit is contained in:
parent
6593594ebf
commit
acbcff1bf4
|
@ -1,6 +1,8 @@
|
||||||
#lang racket
|
#lang racket
|
||||||
(require setup/dirs)
|
(require setup/dirs)
|
||||||
|
|
||||||
|
(provide check-one)
|
||||||
|
|
||||||
;; Paths from the build location shouldn't show up in bytecode files
|
;; Paths from the build location shouldn't show up in bytecode files
|
||||||
;; or documentation. Check ".zo", ".dep", and ".html" files in the
|
;; or documentation. Check ".zo", ".dep", and ".html" files in the
|
||||||
;; build on the assumption that the first three elements of the
|
;; build on the assumption that the first three elements of the
|
||||||
|
@ -14,18 +16,18 @@
|
||||||
(take (explode-path (find-collects-dir))
|
(take (explode-path (find-collects-dir))
|
||||||
3))))))
|
3))))))
|
||||||
|
|
||||||
(define (check-content rx:name)
|
(define (check-one file)
|
||||||
(lambda (name kind v)
|
(call-with-input-file*
|
||||||
(when (regexp-match? rx:name name)
|
file
|
||||||
(call-with-input-file* name
|
|
||||||
(lambda (in)
|
(lambda (in)
|
||||||
(when (regexp-match? rx:dir in)
|
(when (regexp-match? rx:dir in)
|
||||||
(eprintf "Found ~s in ~s\n" rx:dir name)))))))
|
(eprintf "Found ~s in ~s\n" rx:dir file)))))
|
||||||
|
|
||||||
(fold-files (check-content #rx"[.](?:zo|dep)$")
|
(define ((check-content rx:name) name kind v)
|
||||||
(void)
|
(when (regexp-match? rx:name name)
|
||||||
(find-collects-dir))
|
(check-one name)))
|
||||||
|
|
||||||
|
(module+ main
|
||||||
(fold-files (check-content #rx"[.](?:zo|dep)$")
|
(fold-files (check-content #rx"[.](?:zo|dep)$")
|
||||||
(void)
|
(void)
|
||||||
(find-pkgs-dir))
|
(find-pkgs-dir))
|
||||||
|
@ -33,4 +35,4 @@
|
||||||
;; Check rendered docs, too:
|
;; Check rendered docs, too:
|
||||||
(fold-files (check-content #rx"[.](?:html)$")
|
(fold-files (check-content #rx"[.](?:html)$")
|
||||||
(void)
|
(void)
|
||||||
(find-doc-dir))
|
(find-doc-dir)))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user