minimal/do: don't create a .did file until after a file is actually built.
With the new "continue" feature on by default, it turned out that ctrl-c during a build, or a .do file returning an error, would mark a target as "built" even though it hadn't been. This would prevent retrying it when you started minimal/do again. Use a temp file instead. It's a little tricky: to prevent accidental recursion, we want to create a file *before* building, but clean up that file when starting the next session. And we rename that file to the actual .did file *after* building successfully.
This commit is contained in:
parent
25d24d117f
commit
ec72beb343
11 changed files with 39 additions and 21 deletions
2
t/360-symlinks/.gitignore
vendored
2
t/360-symlinks/.gitignore
vendored
|
|
@ -1,4 +1,4 @@
|
|||
*.did
|
||||
*.ran
|
||||
*.extra
|
||||
a
|
||||
b
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
echo x >>a.did
|
||||
echo x >>a.ran
|
||||
rm -f $2.extra
|
||||
echo foo >$2.extra
|
||||
ln -s $2.extra $3
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
rm -f a a.extra b b.did
|
||||
rm -f a a.extra b b.ran
|
||||
d0=""
|
||||
redo a
|
||||
redo-ifchange b
|
||||
d1=$(cat b.did)
|
||||
d1=$(cat b.ran)
|
||||
[ "$d0" != "$d1" ] || exit 11
|
||||
|
||||
# b only rebuilds if a changes
|
||||
../flush-cache
|
||||
redo-ifchange b
|
||||
d2=$(cat b.did)
|
||||
d2=$(cat b.ran)
|
||||
[ "$d1" = "$d2" ] || exit 12
|
||||
|
||||
. ../skip-if-minimal-do.sh
|
||||
|
|
@ -20,7 +20,7 @@ d2=$(cat b.did)
|
|||
../flush-cache
|
||||
redo a
|
||||
redo-ifchange b
|
||||
d3=$(cat b.did)
|
||||
d3=$(cat b.ran)
|
||||
[ "$d2" != "$d3" ] || exit 13
|
||||
|
||||
# Explicitly check that changing a's symlink target (a.extra) does *not*
|
||||
|
|
@ -30,5 +30,5 @@ d3=$(cat b.did)
|
|||
../flush-cache
|
||||
touch a.extra
|
||||
redo-ifchange b
|
||||
d4=$(cat b.did)
|
||||
d4=$(cat b.ran)
|
||||
[ "$d3" = "$d4" ] || exit 14
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
echo x >>b.did
|
||||
echo x >>b.ran
|
||||
redo-ifchange a
|
||||
cat a >$3
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
rm -f *~ .*~ a b *.extra *.did
|
||||
rm -f *~ .*~ a b *.extra *.ran
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue