Search parent directories for default*.do.
Previously, we would only search for default*.do in the same directory in the target; now we search parent directories as well. Let's say we're in a/b/ and trying to build foo.o. If we find ../../default.o.do, then we'll run cd ../..; sh default.o.do a/b/foo .o $TMPNAME In other words, we still always chdir to the same directory as the .do file. But now $1 might have a path in it, not just a basename.
This commit is contained in:
parent
e207b723b4
commit
0dcc3f61b6
16 changed files with 117 additions and 32 deletions
36
t/defaults-nested/test.do
Normal file
36
t/defaults-nested/test.do
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
exec >&2
|
||||
redo-ifchange \
|
||||
file.x.y.z file.z file \
|
||||
a/b/file.x.y.z a/b/file.y.z a/b/file.z a/b/file \
|
||||
a/d/file.x.y.z a/d/file.y.z a/d/file.z a/d/file
|
||||
|
||||
(cd a/b && redo-ifchange ../file.x.y.z ../file.y.z ../file.z ../file)
|
||||
|
||||
check()
|
||||
{
|
||||
if [ "$(cat $1)" != "$2" ]; then
|
||||
echo "$1 should contain '$2'"
|
||||
echo " ...got '$(cat $1)'"
|
||||
exit 44
|
||||
fi
|
||||
}
|
||||
|
||||
check file.x.y.z "root file.x.y.z"
|
||||
check file.z "root file.z"
|
||||
check file "root file"
|
||||
|
||||
check a/file.x.y.z "default.x.y.z file .x.y.z"
|
||||
check a/file.y.z "default.z file.y .z"
|
||||
check a/file.z "default.z file .z"
|
||||
check a/file "root a/file"
|
||||
|
||||
check a/b/file.x.y.z "file file.x.y.z"
|
||||
check a/b/file.y.z "default.y.z file .y.z"
|
||||
check a/b/file.z "default.z b/file .z"
|
||||
check a/b/file "root a/b/file"
|
||||
|
||||
check a/d/file.x.y.z "default file.x.y.z"
|
||||
check a/d/file.y.z "default file.y.z"
|
||||
check a/d/file.z "default file.z"
|
||||
check a/d/file "default file"
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue