minimal/do: less aggressive 'all' default; add fake redo-{sources,targets,ood}.

If redo-ifchange is a symlink to minimal/do, and we run it from
*outside* an existing session, it shouldn't default to 'all'.

redo-sources, redo-targets, and redo-ood aren't too useful with
minimal/do, but they should exist in case someone tries to use them, so
just symlink them to /bin/true, like we do with redo-ifcreate.
This commit is contained in:
Avery Pennarun 2018-11-02 03:46:16 -04:00
commit 25d24d117f

View file

@ -72,7 +72,9 @@ _debug() {
if [ -z "$DO_BUILT" -a "$_cmd" != "redo-whichdo" ]; then
DO_TOP=1
[ "$#" -gt 0 ] || set all # only toplevel redo has a default target
if [ "$#" -eq 0 ] && [ "$_cmd" = "do" -o "$_cmd" = "redo" ]; then
set all # only toplevel redo has a default target
fi
export DO_BUILT=$PWD/.do_built
: >>"$DO_BUILT"
sort -u "$DO_BUILT" >"$DO_BUILT.new"
@ -90,7 +92,8 @@ if [ -z "$DO_BUILT" -a "$_cmd" != "redo-whichdo" ]; then
ln -s "$REDO" "$DO_PATH/$d"
done
[ -e /bin/true ] && TRUE=/bin/true || TRUE=/usr/bin/true
for d in redo-ifcreate redo-stamp redo-always; do
for d in redo-ifcreate redo-stamp redo-always redo-ood \
redo-targets redo-sources; do
ln -s $TRUE "$DO_PATH/$d"
done
fi