diff --git a/deps.py b/deps.py index 93063f9..173cd72 100644 --- a/deps.py +++ b/deps.py @@ -58,10 +58,15 @@ def isdirty(f, depth, max_changed, assert(mode in ('c','m')) if not f.csum: # f is a "normal" target: dirty f2 means f is instantly dirty - if dirty: - # if dirty==DIRTY, this means f is definitely dirty. - # if dirty==[...], it's a list of the uncertain children. - return dirty + if dirty == DIRTY: + # f2 is definitely dirty, so f definitely needs to + # redo. + return DIRTY + elif isinstance(dirty,list): + # our child f2 might be dirty, but it's not sure yet. It's + # given us a list of targets we have to redo in order to + # be sure. + must_build += dirty else: # f is "checksummable": dirty f2 means f needs to redo, # but f might turn out to be clean after that (ie. our parent @@ -83,6 +88,7 @@ def isdirty(f, depth, max_changed, # objects in the tree. If we build all those, we can then # redo-ifchange f and it won't have any uncertainty next time. return must_build + debug('%s-- CLEAN\n' % (depth,)) # if we get here, it's because the target is clean if f.is_override: diff --git a/state.py b/state.py index b9dd259..f5be070 100644 --- a/state.py +++ b/state.py @@ -200,6 +200,9 @@ class File(object): else: return self._init_from_idname(id, name) + def __repr__(self): + return "File(%r)" % (self.nicename(),) + def refresh(self): self._init_from_idname(self.id, None) diff --git a/t/660-stamp/.gitignore b/t/660-stamp/.gitignore index ae5524f..f789dc9 100644 --- a/t/660-stamp/.gitignore +++ b/t/660-stamp/.gitignore @@ -4,3 +4,9 @@ /inp /bob /usestamp2 +/a +/b +/ab +/doing_ab +/abc +/doing_abc diff --git a/t/660-stamp/a.do b/t/660-stamp/a.do new file mode 100644 index 0000000..3bb0c39 --- /dev/null +++ b/t/660-stamp/a.do @@ -0,0 +1,3 @@ +redo-always +echo a | redo-stamp +echo a > $3 diff --git a/t/660-stamp/ab.do b/t/660-stamp/ab.do new file mode 100644 index 0000000..751c007 --- /dev/null +++ b/t/660-stamp/ab.do @@ -0,0 +1,4 @@ +redo-ifchange a b +echo "doing ab" >&2 +echo ab >$3 +touch doing_ab diff --git a/t/660-stamp/abc.do b/t/660-stamp/abc.do new file mode 100644 index 0000000..d97d9e1 --- /dev/null +++ b/t/660-stamp/abc.do @@ -0,0 +1,4 @@ +redo-ifchange ab c +echo "doing abc" >&2 +echo abc >$3 +touch doing_abc diff --git a/t/660-stamp/b.do b/t/660-stamp/b.do new file mode 100644 index 0000000..4326b6e --- /dev/null +++ b/t/660-stamp/b.do @@ -0,0 +1,3 @@ +redo-always +echo b | redo-stamp +echo b > $3 diff --git a/t/660-stamp/c b/t/660-stamp/c new file mode 100644 index 0000000..e69de29 diff --git a/t/660-stamp/clean.do b/t/660-stamp/clean.do index 3bdd118..80faf52 100644 --- a/t/660-stamp/clean.do +++ b/t/660-stamp/clean.do @@ -1 +1 @@ -rm -f *.log usestamp usestamp2 stampy inp bob *~ .*~ +rm -f *.log usestamp usestamp2 stampy inp bob *~ .*~ a b ab doing_ab diff --git a/t/660-stamp/stamptest.do b/t/660-stamp/stamptest.do index 51bb3f1..6e318ed 100644 --- a/t/660-stamp/stamptest.do +++ b/t/660-stamp/stamptest.do @@ -70,3 +70,16 @@ redo-ifchange usestamp usestamp2 rm -f stampy redo-ifchange stampy [ "$(wc -l