--- setup.sh 2020-07-18 10:13:04.994912357 -0400 +++ setup.sh 2020-07-18 10:16:38.985654960 -0400 @@ -166,15 +166,7 @@ return fi - echo "Do you want to register the Zephyr-sdk at location: $target_sdk_dir" - echo " in the CMake package registry (y/n)?" - - while read confirm; do - [ "$confirm" = "Y" -o "$confirm" = "y" -o "$confirm" = "n" \ - -o "$confirm" = "N" ] && break - echo "Invalid input \"$confirm\", please input 'y' or 'n': " - done - + read_confirm "registering Zephyr-sdk CMake module (at $target_sdk_dir)" if [ "$confirm" = "y" -o "$confirm" = "Y" ]; then if [ ! -d $ZEPHYR_SDK_REGISTRY_DIR ]; then mkdir -p $ZEPHYR_SDK_REGISTRY_DIR --- pkg/zephyr-sdk/opt/zephyr-sdk/setup.sh.orig 2020-07-18 10:27:09.440996750 -0400 +++ pkg/zephyr-sdk/opt/zephyr-sdk/setup.sh 2020-07-18 10:28:11.268841053 -0400 @@ -71,7 +71,10 @@ ;; -y ) confirm="y"; - rc_confirm="y"; + if [ -z "$rc_confirm" ] + then + rc_confirm="y" + fi ;; -rc ) rc_confirm="y"; --- pkg/zephyr-sdk/opt/zephyr-sdk/setup.sh.orig 2020-07-18 11:12:04.328724883 -0400 +++ pkg/zephyr-sdk/opt/zephyr-sdk/setup.sh 2020-07-18 11:12:40.741607822 -0400 @@ -158,7 +158,7 @@ do_cmake_package() { - ZEPHYR_SDK_REGISTRY_DIR=$HOME/.cmake/packages/Zephyr-sdk + : ${ZEPHYR_SDK_REGISTRY_DIR:=$HOME/.cmake/packages/Zephyr-sdk} type md5sum if [ $? -eq 0 ]; then