fixed: check if prereq exists when calculating md5-sum, check if
target has prereqs when md5 used, typo
This commit is contained in:
parent
92821d9337
commit
a5852a70ba
|
@ -141,15 +141,17 @@
|
||||||
|
|
||||||
(define (checksum-for-file fname)
|
(define (checksum-for-file fname)
|
||||||
(let ((file (expand-file-name fname (cwd))))
|
(let ((file (expand-file-name fname (cwd))))
|
||||||
(and (file-exists? file)
|
(if (file-exists? file)
|
||||||
(md5-digest->number (md5-digest-for-port (open-input-file file))))))
|
(md5-digest->number (md5-digest-for-port (open-input-file file)))
|
||||||
|
(error "checksum-for-file: file does not exist" file))))
|
||||||
|
|
||||||
;;; optimizations possible: global variable with known checksums
|
;;; optimizations possible: global variable with known checksums
|
||||||
(define (get-file-checksum fname)
|
(define (get-file-checksum fname)
|
||||||
(checksum-for-file fname))
|
(checksum-for-file fname))
|
||||||
|
|
||||||
(define (same-checksum? target extensions prereqs)
|
(define (same-checksum? target extensions prereqs)
|
||||||
(or (null? prereqs)
|
(if (null? prereqs)
|
||||||
|
(error "same-checksum?: target has no prerequisites" target)
|
||||||
(let for-each-prereq ((current-prereq (car prereqs))
|
(let for-each-prereq ((current-prereq (car prereqs))
|
||||||
(previous-total 0)
|
(previous-total 0)
|
||||||
(todo-prereqs (cdr prereqs)))
|
(todo-prereqs (cdr prereqs)))
|
||||||
|
@ -220,7 +222,7 @@
|
||||||
(make-always-build-func target-name cooked-prereqs thunk)))
|
(make-always-build-func target-name cooked-prereqs thunk)))
|
||||||
|
|
||||||
(define (make-common-once target-descr . prereqs)
|
(define (make-common-once target-descr . prereqs)
|
||||||
(lambda args (apply make-common-once args)))
|
(lambda args (apply make-once args)))
|
||||||
|
|
||||||
(define (make-common-once-build-func target-descr prereqs thunk)
|
(define (make-common-once-build-func target-descr prereqs thunk)
|
||||||
(lambda (target-name cooked-prereqs)
|
(lambda (target-name cooked-prereqs)
|
||||||
|
|
Loading…
Reference in New Issue