minimal/do: support searching parent dirs for .do files.

Now all tests pass again with both redo and minimal/do.
This commit is contained in:
Avery Pennarun 2011-01-15 21:44:08 -08:00
commit c7f06448c5

View file

@ -51,7 +51,7 @@ if [ -z "$DO_BUILT" ]; then
fi fi
_find_dofile() _find_dofile_pwd()
{ {
DOFILE=default.$1.do DOFILE=default.$1.do
while :; do while :; do
@ -64,6 +64,21 @@ _find_dofile()
} }
_find_dofile()
{
PREFIX=
while :; do
_find_dofile_pwd "$1"
[ -e "$DOFILE" ] && break
[ "$PWD" = "/" ] && break
TARGET=${PWD##*/}/$TARGET
PREFIX=${PWD##*/}/$PREFIX
cd ..
done
BASE=$PREFIX$BASE
}
_run_dofile() _run_dofile()
{ {
export DO_DEPTH="$DO_DEPTH " export DO_DEPTH="$DO_DEPTH "