minimal/do: 'redo-ifchange' with no parameters shouldn't try to build all.

It should just build nothing.  Because sometimes you want to do something
like:
	redo-ifchange $(find -name '*.c')

And the find doesn't return any results.  This is consistent with what real
redo does.

Added a test to confirm that it works.
This commit is contained in:
Avery Pennarun 2011-02-26 18:01:31 -08:00
commit cfc3f44d64
3 changed files with 5 additions and 6 deletions

View file

@ -30,6 +30,7 @@ export REDO=$(cd "${dir:-.}" && echo "$PWD/$base")
DO_TOP=
if [ -z "$DO_BUILT" ]; then
DO_TOP=1
[ -n "$*" ] || set all # only toplevel redo has a default target
export DO_BUILT=$PWD/.do_built
: >>"$DO_BUILT"
echo "Removing previously built files..." >&2
@ -139,11 +140,7 @@ redo()
set -e
if [ -n "$*" ]; then
redo "$@"
else
redo all
fi
redo "$@"
if [ -n "$DO_TOP" ]; then
echo "Removing stamp files..." >&2