From e31e170438d1026c5ddbba624f04a0272cd0581d Mon Sep 17 00:00:00 2001 From: Titus Date: Thu, 19 Oct 2023 03:01:07 +0200 Subject: [PATCH] Tools/setup/ubuntu.sh: fix GCC_VER_STR failure handling (#22007) * Fixed an issue where if the GCC_VER_STR would not contain the right NUTTX_GCC_VERSION, the grep -c command would throw a failure, silently exiting the entire ubuntu.sh setup script --- Tools/setup/ubuntu.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/setup/ubuntu.sh b/Tools/setup/ubuntu.sh index af7ec2fbff..a6bdf9b780 100755 --- a/Tools/setup/ubuntu.sh +++ b/Tools/setup/ubuntu.sh @@ -165,7 +165,7 @@ if [[ $INSTALL_NUTTX == "true" ]]; then source $HOME/.profile # load changed path for the case the script is reran before relogin if [ $(which arm-none-eabi-gcc) ]; then GCC_VER_STR=$(arm-none-eabi-gcc --version) - GCC_FOUND_VER=$(echo $GCC_VER_STR | grep -c "${NUTTX_GCC_VERSION}") + GCC_FOUND_VER=$(echo $GCC_VER_STR | grep -c "${NUTTX_GCC_VERSION}" || true) fi if [[ "$GCC_FOUND_VER" == "1" ]]; then