diff --git a/build/02_install_build_compiler.sh b/build/02_install_build_compiler.sh index 7e6fd97..bb70c9e 100755 --- a/build/02_install_build_compiler.sh +++ b/build/02_install_build_compiler.sh @@ -1,4 +1,10 @@ #!/bin/bash + +function die(){ + echo "$1" + exit 1 +} + if [ $# -ne 1 ];then echo "Missing arch" exit 1 @@ -20,7 +26,8 @@ case $ARCH in ;; esac HOST=http://musl.cc +echo "Fetching ${HOST}/${ARCH}-cross.tgz" cd / -curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz -tar -xf ${ARCH}-cross.tgz -rm ${ARCH}-cross.tgz \ No newline at end of file +curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz || die "Failed to download build compiler package" +tar -xf ${ARCH}-cross.tgz || die "Failed to extract build compiler package" +rm ${ARCH}-cross.tgz || die "Failed to remove build compiler package" \ No newline at end of file