diff options
author | Rob Landley <rob@landley.net> | 2020-03-02 17:52:04 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2020-03-02 17:52:04 -0600 |
commit | a83a057383151ddc5bfd9eea4c45af5de8e68bd3 (patch) | |
tree | 73ee8b81c0c2fee017569382fb2b581bb7b84fb3 /scripts | |
parent | 20876694ab8f9ee1a821e464541d85e733fd44e0 (diff) | |
download | toybox-a83a057383151ddc5bfd9eea4c45af5de8e68bd3.tar.gz |
Move "scripts/cross.sh all" log files into root/log.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/cross.sh | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/scripts/cross.sh b/scripts/cross.sh index 2570713d..bdf03ed9 100755 --- a/scripts/cross.sh +++ b/scripts/cross.sh @@ -25,6 +25,9 @@ list() } [ $# -eq 0 ] && list && exit +[ -z "$TOP" ] && TOP="$PWD/root/log" +mkdir -p "$TOP" || exit 1 + X="$1" shift @@ -33,11 +36,18 @@ if [ "$X" == all ] then for TARGET in $(list) do + LOG="$TOP/cross-log-$TARGET" { export TARGET echo -en "\033]2;$TARGET $*\007" - "$0" $TARGET "$@" 2>&1 || mv cross-log-$TARGET.{txt,failed} - } | tee cross-log-$TARGET.txt + + rm -f "$LOG".{failed,success} + "$0" $TARGET "$@" 2>&1 + X=$? + [ $X -eq 0 -o $X -eq 42 ] && mv "$LOG".{txt,success} + } |& tee "$LOG".txt + [ -z "$ALL" ] && [ ! -e "$LOG".success ] && + { mv "$LOG".{txt,failed} ; break;} done exit |