From 8291480da9367ab29fc1de7461e489b62bd27dbe Mon Sep 17 00:00:00 2001 From: Denys Havrysh Date: Fri, 29 Apr 2016 17:03:48 +0300 Subject: [PATCH] Disable shell warning about unbound variable during git install --- bootstrap-salt.sh | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index dd73884..1c9bd1d 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -477,22 +477,26 @@ if [ "$ITYPE" = "git" ]; then GIT_REV="$1" shift fi + + # Disable shell warning about unbound variable during git install + STABLE_REV="" + # If doing stable install, check if version specified elif [ "$ITYPE" = "stable" ]; then if [ "$#" -eq 0 ];then STABLE_REV="latest" else __check_unparsed_options "$*" - if [ "$(echo "$1" | egrep '^(latest|1\.6|1\.7|2014\.1|2014\.7|2015\.5|2015\.8)$')" != "" ]; then - STABLE_REV="$1" - shift - elif [ "$(echo "$1" | egrep '^([0-9]*\.[0-9]*\.[0-9]*)$')" != "" ]; then - STABLE_REV="archive/$1" - shift - else - echo "Unknown stable version: $1 (valid: 1.6, 1.7, 2014.1, 2014.7, 2015.5, 2015.8, latest, \$MAJOR.\$MINOR.\$PATCH)" - exit 1 + if [ "$(echo "$1" | egrep '^(latest|1\.6|1\.7|2014\.1|2014\.7|2015\.5|2015\.8)$')" != "" ]; then + STABLE_REV="$1" + shift + elif [ "$(echo "$1" | egrep '^([0-9]*\.[0-9]*\.[0-9]*)$')" != "" ]; then + STABLE_REV="archive/$1" + shift + else + echo "Unknown stable version: $1 (valid: 1.6, 1.7, 2014.1, 2014.7, 2015.5, 2015.8, latest, \$MAJOR.\$MINOR.\$PATCH)" + exit 1 fi fi fi