minimal/do: some shells return error in "read x <file" for empty files.

...or files that contain bytes but not a trailing newline.  It's okay if we
don't get any data, but we definitely have to *not* let "set -e" abort us.
Now that we fixed set -e in the previous patch, it revealed this problem.
This commit is contained in:
Avery Pennarun 2012-02-09 00:39:38 -05:00
commit 33dadbfe07

View file

@ -94,7 +94,7 @@ _run_dofile()
export REDO_TARGET=$PWD/$target export REDO_TARGET=$PWD/$target
local line1 local line1
set -e set -e
read line1 <"$PWD/$dofile" read line1 <"$PWD/$dofile" || true
cmd=${line1#"#!/"} cmd=${line1#"#!/"}
if [ "$cmd" != "$line1" ]; then if [ "$cmd" != "$line1" ]; then
/$cmd "$PWD/$dofile" "$@" >"$tmp.tmp2" /$cmd "$PWD/$dofile" "$@" >"$tmp.tmp2"