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

2
t/blank/blank.do Normal file
View file

@ -0,0 +1,2 @@
redo-ifchange

View file

@ -4,4 +4,4 @@ redo nonshelltest shelltest \
deltest deltest2 test.args test2.args passfailtest chdirtest \ deltest deltest2 test.args test2.args passfailtest chdirtest \
curse/test deps/test "space dir/test" modetest makedir2 \ curse/test deps/test "space dir/test" modetest makedir2 \
silencetest touchtest stamp/test alwaystest ifcreate-test \ silencetest touchtest stamp/test alwaystest ifcreate-test \
unicode unicode blank/blank