From 9e7cce8b94c099d762b032731156e41385ce1566 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 8 Sep 2019 20:43:34 +0200 Subject: [PATCH] Update --- danio_gcc.sh | 40 +++++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/danio_gcc.sh b/danio_gcc.sh index dc9c723..1152a86 100755 --- a/danio_gcc.sh +++ b/danio_gcc.sh @@ -1,11 +1,10 @@ #!/bin/bash -set -e -trap 'previous_command=$this_command; this_command=$BASH_COMMAND' DEBUG -trap 'echo FAILED COMMAND: $previous_command' EXIT - runit() { + set -e + trap 'previous_command=$this_command; this_command=$BASH_COMMAND' DEBUG + trap 'echo FAILED COMMAND: $previous_command' EXIT #### ZMIEŃ, JEŻELI CHCESZ INNE WERSJE, DOMYŚLNE "master", CZYLI "BLEEDING EDGE" export binutils_version="master" @@ -169,6 +168,37 @@ runit() fi } +ask_for_sub() +{ + while :; do + reset || clear + echo "Would you like to build ${arch}-danio-linux-gnueabi{hf,} ?" + echo "[1] - yes" + echo "[2] - no" + read junk + case ${junk} in + 1) return 0 ;; + 2) return 1 ;; + esac + done +} + +choose_sub() +{ + while :; do + reset || clear + echo "Choose sub-base for ${arch}-danio-linux-" + echo "[1] is ${arch}-danio-linux-gnueabi" + echo "[2] is ${arch}-danio-linux-gnueabihf" + read junk + case ${junk} in + 1) export SUBBASE="-gnueabi"; break ;; + 2) export SUBBASE="-gnueabihf"; break ;; + *) echo "ONLY USE \"1\" OR \"2\"!"; sleep 2 ;; + esac + done +} + targets="`grep ' - t=' .travis.yml | cut -f 2 -d = | cut -f 1 -d ' ' | sort -u`" if [ "${AUTOBUILD}" -ne "0" ]; then export clean="1" @@ -224,7 +254,7 @@ else read BASE case ${BASE} in 1) export BASE="eabi"; break ;; - 2) export BASE="linux"; break ;; + 2) if ask_for_sub; then choose_sub else; break; export BASE="linux"; break; fi ;; 2) export BASE="elf"; break ;; *) echo "ONLY USE \"1\", \"2\" or \"3\"!"; sleep 2 ;; esac