Skip to content

Commit

Permalink
build: do not "exit" a script meant to be "source"d
Browse files Browse the repository at this point in the history
Running exit in a script meant to be sourced means the user shell will
exit, which prevents seeing the error message, and is generally very
annoying.
Fix the "android-configure" script to use "return" instead of "exit".

PR-URL: #35520
Fixes: #35519
Reviewed-By: Michaël Zasso <targos@protonmail.com>
  • Loading branch information
fdgonthier authored and targos committed May 1, 2021
1 parent 8163f31 commit 38921b3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions android-configure
Expand Up @@ -10,7 +10,7 @@

if [ $# -ne 3 ]; then
echo "$0 should have 3 parameters: ndk_path, target_arch and sdk_version"
exit 1
return 1
fi

NDK_PATH=$1
Expand Down Expand Up @@ -44,7 +44,7 @@ case $ARCH in
;;
*)
echo "Unsupported architecture provided: $ARCH"
exit 1
return 1
;;
esac

Expand All @@ -58,7 +58,7 @@ major=$(echo $host_gcc_version | awk -F . '{print $1}')
minor=$(echo $host_gcc_version | awk -F . '{print $2}')
if [ -z $major ] || [ -z $minor ] || [ $major -lt 6 ] || [ $major -eq 6 -a $minor -lt 3 ]; then
echo "host gcc $host_gcc_version is too old, need gcc 6.3.0"
exit 1
return 1
fi

SUFFIX="$TOOLCHAIN_NAME$ANDROID_SDK_VERSION"
Expand Down

0 comments on commit 38921b3

Please sign in to comment.