diff --git a/clean.do b/clean.do index e3835a6..311be33 100644 --- a/clean.do +++ b/clean.do @@ -1,3 +1,8 @@ +if [ -e .do_built ]; then + while read x; do + rm -f "$x" + done <.do_built +fi redo t/clean rm -f *~ .*~ */*~ */.*~ *.pyc -rm -rf .redo t/.redo +rm -rf t/.redo diff --git a/minimal/do b/minimal/do index d1262c8..3e2f152 100755 --- a/minimal/do +++ b/minimal/do @@ -9,7 +9,7 @@ if [ -z "$DO_BUILT" ]; then export DO_BUILT="$PWD/.do_built" if [ -e "$DO_BUILT" ]; then echo "Removing previously built files..." >&2 - sort "$DO_BUILT" | uniq | tee "$DO_BUILT.new" | + sort -u "$DO_BUILT" | tee "$DO_BUILT.new" | while read f; do rm -f "$f"; done mv "$DO_BUILT.new" "$DO_BUILT" fi @@ -55,6 +55,7 @@ _do() RV= ( export DO_DEPTH="$DO_DEPTH " + export REDO_TARGET="$PWD/$TARGET" set -e . "$PWD/$DOFILE" >"$TARGET.tmp" ) || RV="$?" @@ -82,6 +83,8 @@ redo() alias redo-ifchange="redo" alias redo-ifcreate=":" +alias redo-stamp=":" +alias redo-always=":" set -e if [ -n "$*" ]; then diff --git a/t/alwaystest.do b/t/alwaystest.do index 03dc6c9..85fdf8f 100644 --- a/t/alwaystest.do +++ b/t/alwaystest.do @@ -10,4 +10,5 @@ redo always1 ./flush-cache.sh redo-ifchange always1 +. ./skip-if-minimal-do.sh [ "$(wc -l t1, c1=$C1, c2=$C2" >&2 exit 55 diff --git a/t/deps/doublestatic.do b/t/deps/doublestatic.do index a1c4f0f..a385cc5 100644 --- a/t/deps/doublestatic.do +++ b/t/deps/doublestatic.do @@ -7,4 +7,5 @@ touch static.in redo-ifchange static1 static2 COUNT=$(wc -l &1 && exit 55 redo overwrite2 2>&1 && exit 56 redo overwrite3 2>&1 && exit 57 diff --git a/t/deps/test2.do b/t/deps/test2.do index 0c8c7a7..470cd2b 100644 --- a/t/deps/test2.do +++ b/t/deps/test2.do @@ -2,6 +2,7 @@ rm -f t2.count redo t2 redo t2 OUT=$(cat t2.count | wc -l) +. ../skip-if-minimal-do.sh if [ "$OUT" != 2 ]; then echo "t2: expected 2" exit 43 diff --git a/t/flush-cache.sh b/t/flush-cache.sh index 253b43d..7bd22fa 100755 --- a/t/flush-cache.sh +++ b/t/flush-cache.sh @@ -1,9 +1,12 @@ #!/bin/sh #echo "Flushing redo cache..." >&2 -( - echo ".timeout 5000" - echo "pragma synchronous = off;" - echo "update Files set checked_runid=checked_runid-1, " \ - " changed_runid=changed_runid-1, " \ - " failed_runid=failed_runid-1;" -) | sqlite3 "$REDO_BASE/.redo/db.sqlite3" +if [ -z "$DO_BUILT" ]; then + ( + echo ".timeout 5000" + echo "pragma synchronous = off;" + echo "update Files set checked_runid=checked_runid-1, " \ + " changed_runid=changed_runid-1, " \ + " failed_runid=failed_runid-1;" + ) | sqlite3 "$REDO_BASE/.redo/db.sqlite3" +fi + diff --git a/t/makedir2.do b/t/makedir2.do index e4673b3..07796d1 100644 --- a/t/makedir2.do +++ b/t/makedir2.do @@ -1,3 +1,4 @@ +. ./skip-if-minimal-do.sh rm -f makedir.log redo makedir touch makedir/outfile diff --git a/t/passfailtest.do b/t/passfailtest.do index 52bb0e9..d717f05 100644 --- a/t/passfailtest.do +++ b/t/passfailtest.do @@ -1,3 +1,5 @@ +. ./skip-if-minimal-do.sh + rm -f pleasefail redo passfail [ -e passfail ] || exit 42 diff --git a/t/silencetest.do b/t/silencetest.do index 098272c..2b3de77 100644 --- a/t/silencetest.do +++ b/t/silencetest.do @@ -3,5 +3,6 @@ redo silence [ -e silence ] || exit 55 echo 'true' >silence.do redo silence +. ./skip-if-minimal-do.sh [ ! -e silence ] || exit 66 rm -f silence.do diff --git a/t/skip-if-minimal-do.sh b/t/skip-if-minimal-do.sh new file mode 100644 index 0000000..3d63761 --- /dev/null +++ b/t/skip-if-minimal-do.sh @@ -0,0 +1,5 @@ +if [ -n "$DO_BUILT" ]; then + echo "$REDO_TARGET: skipping: not supported in minimal/do." >&2 + exit 0 +fi + diff --git a/t/stamp/stamptest.do b/t/stamp/stamptest.do index bb6ed4f..19a2f5a 100644 --- a/t/stamp/stamptest.do +++ b/t/stamp/stamptest.do @@ -14,6 +14,7 @@ redo-ifchange usestamp ../flush-cache.sh redo stampy +. ../skip-if-minimal-do.sh [ "$(wc -l