make-is-out-of-date? is more readable now; small improvement
target-mtime doesn't need to be checked for each prereq.
This commit is contained in:
parent
9e1b812cfd
commit
c411f67a2c
|
@ -6,7 +6,7 @@
|
||||||
(let ((cooked-state (last args))
|
(let ((cooked-state (last args))
|
||||||
(prereqs-results (cdr (reverse (cdr args)))))
|
(prereqs-results (cdr (reverse (cdr args)))))
|
||||||
(cons (begin
|
(cons (begin
|
||||||
(display ";;; rule : ")
|
(display ";;; file : ")
|
||||||
(display target)
|
(display target)
|
||||||
(newline)
|
(newline)
|
||||||
(bind-fluids-gnu target prereqs prereqs-results thunk))
|
(bind-fluids-gnu target prereqs prereqs-results thunk))
|
||||||
|
@ -64,15 +64,19 @@
|
||||||
(lambda args
|
(lambda args
|
||||||
; (breakpoint "make-is-out-of-date?")
|
; (breakpoint "make-is-out-of-date?")
|
||||||
(let ((init-state (last args)))
|
(let ((init-state (last args)))
|
||||||
(cons (or (file-not-exists? target)
|
(cons (if (file-not-exists? target)
|
||||||
(and (not (null? prereqs))
|
#t
|
||||||
|
(if (null? prereqs)
|
||||||
|
#f
|
||||||
|
(let ((target-mtime (file-last-mod target)))
|
||||||
(let for-each-prereq ((prereq (car prereqs))
|
(let for-each-prereq ((prereq (car prereqs))
|
||||||
(todo (cdr prereqs)))
|
(todo (cdr prereqs)))
|
||||||
(cond
|
(cond
|
||||||
((file-not-exists? prereq) #t)
|
((file-not-exists? prereq)
|
||||||
((> (file-last-mod prereq) (file-last-mod target)) #t)
|
(error "nonexistent prerequisite" prereq))
|
||||||
|
((> (file-last-mod prereq) target-mtime) #t)
|
||||||
((null? todo) #f)
|
((null? todo) #f)
|
||||||
(else (for-each-prereq (car todo) (cdr todo)))))))
|
(else (for-each-prereq (car todo) (cdr todo))))))))
|
||||||
init-state))))
|
init-state))))
|
||||||
|
|
||||||
(define (make-md5-sum-changed? target . prereqs)
|
(define (make-md5-sum-changed? target . prereqs)
|
||||||
|
|
Loading…
Reference in New Issue