aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2020-03-02 18:47:57 -0600
committerRob Landley <rob@landley.net>2020-03-02 18:47:57 -0600
commit2598f40a611e61191cef6e9e81de8906458dd893 (patch)
treeef87bb81b7d05d01545902f83022efd9cc45f323 /scripts
parenta83a057383151ddc5bfd9eea4c45af5de8e68bd3 (diff)
downloadtoybox-2598f40a611e61191cef6e9e81de8906458dd893.tar.gz
More cross.sh tweaks.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/cross.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/cross.sh b/scripts/cross.sh
index bdf03ed9..bee836ec 100755
--- a/scripts/cross.sh
+++ b/scripts/cross.sh
@@ -8,6 +8,8 @@
# With no arguments, lists available targets. Use target "all" to iterate
# through each $TARGET from the list.
+trap "exit 1" INT
+
CCC="$(dirname "$(readlink -f "$0")")"/../ccc
if [ ! -d "$CCC" ]
then
@@ -21,7 +23,7 @@ unset X Y
# Display target list?
list()
{
- ls "$CCC" | sed 's/-.*//' | sort -u | xargs
+ ls "$CCC" | sed -n 's/-.*//p' | sort -u | xargs
}
[ $# -eq 0 ] && list && exit
@@ -44,10 +46,9 @@ then
rm -f "$LOG".{failed,success}
"$0" $TARGET "$@" 2>&1
X=$?
- [ $X -eq 0 -o $X -eq 42 ] && mv "$LOG".{txt,success}
+ [ $X -eq 0 ] && mv "$LOG".{txt,success}
} |& tee "$LOG".txt
- [ -z "$ALL" ] && [ ! -e "$LOG".success ] &&
- { mv "$LOG".{txt,failed} ; break;}
+ [ ! -e "$LOG".success ] && { mv "$LOG".{txt,failed};[ -z "$ALL" ] && break;}
done
exit