From 25d24d117fcacb1b127c72124fc27cb86dd7a478 Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Fri, 2 Nov 2018 03:46:16 -0400 Subject: [PATCH] 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. --- minimal/do | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/minimal/do b/minimal/do index 3091fae..2050c12 100755 --- a/minimal/do +++ b/minimal/do @@ -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