aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2020-03-02 17:52:04 -0600
committerRob Landley <rob@landley.net>2020-03-02 17:52:04 -0600
commita83a057383151ddc5bfd9eea4c45af5de8e68bd3 (patch)
tree73ee8b81c0c2fee017569382fb2b581bb7b84fb3
parent20876694ab8f9ee1a821e464541d85e733fd44e0 (diff)
downloadtoybox-a83a057383151ddc5bfd9eea4c45af5de8e68bd3.tar.gz
Move "scripts/cross.sh all" log files into root/log.
-rw-r--r--Makefile2
-rwxr-xr-xscripts/cross.sh14
2 files changed, 13 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 69d24870..316df2f8 100644
--- a/Makefile
+++ b/Makefile
@@ -65,7 +65,7 @@ root_clean:
@echo root cleaned
clean::
- @rm -rf toybox generated change .singleconfig* cross-log-*.*
+ @rm -rf toybox generated change .singleconfig*
@echo cleaned
# If singlemake was in generated/ "make clean; make test_ls" wouldn't work.
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