We sometimes missed deps when more than one dep required a stamp check.

If must_build was nonempty when recursively calling isdirty() that
returned a list, we'd lose the original value of must_build.
This commit is contained in:
Alan Falloon 2015-05-06 17:56:14 -04:00 committed by Avery Pennarun
commit 67c1d4f7d8
10 changed files with 47 additions and 5 deletions

View file

@ -4,3 +4,9 @@
/inp
/bob
/usestamp2
/a
/b
/ab
/doing_ab
/abc
/doing_abc

3
t/660-stamp/a.do Normal file
View file

@ -0,0 +1,3 @@
redo-always
echo a | redo-stamp
echo a > $3

4
t/660-stamp/ab.do Normal file
View file

@ -0,0 +1,4 @@
redo-ifchange a b
echo "doing ab" >&2
echo ab >$3
touch doing_ab

4
t/660-stamp/abc.do Normal file
View file

@ -0,0 +1,4 @@
redo-ifchange ab c
echo "doing abc" >&2
echo abc >$3
touch doing_abc

3
t/660-stamp/b.do Normal file
View file

@ -0,0 +1,3 @@
redo-always
echo b | redo-stamp
echo b > $3

0
t/660-stamp/c Normal file
View file

View file

@ -1 +1 @@
rm -f *.log usestamp usestamp2 stampy inp bob *~ .*~
rm -f *.log usestamp usestamp2 stampy inp bob *~ .*~ a b ab doing_ab

View file

@ -70,3 +70,16 @@ redo-ifchange usestamp usestamp2
rm -f stampy
redo-ifchange stampy
[ "$(wc -l <stampy.log)" -eq 6 ] || exit 74
# check that a target that depends on two stamped targets (that are marked as
# always built) won't be redone if neither stamped targets changes
../flush-cache
redo-ifchange abc
rm -f doing_ab doing_abc
redo-ifchange abc
[ ! -f doing_ab ] || exit 92
[ ! -f doing_abc ] || exit 93
../flush-cache
redo-ifchange abc
[ ! -f doing_ab ] || exit 94
[ ! -f doing_abc ] || exit 95