prototypes: xci: xci-deploy: Set default value for devel parameters 73/36973/1
authorMarkos Chandras <mchandras@suse.de>
Wed, 5 Jul 2017 14:06:49 +0000 (15:06 +0100)
committerMarkos Chandras <mchandras@suse.de>
Wed, 5 Jul 2017 14:09:31 +0000 (15:09 +0100)
Commit 68412ffc734e ("prototypes: xci: xci-deploy.sh: Append trailing
slash for rsync vars") modified xci-deploy.sh script to append a
trailing slash to the devel variables but it broke the script when
one of these variables was not set (since we run with 'set -eu') with
the following error:

./xci-deploy.sh: line 45: !local_user_var: unbound variable

Fixes: I0103b754585931fa1dcd3966c52d7e4a8f2f63f6
Change-Id: Ic2465ff07348b61e74e191516425cd10d80c1fce
Signed-off-by: Markos Chandras <mchandras@suse.de>
prototypes/xci/xci-deploy.sh

index a72c927..d711256 100755 (executable)
@@ -42,7 +42,7 @@ source $XCI_PATH/config/env-vars
 #-------------------------------------------------------------------------------
 user_local_dev_vars=(OPNFV_RELENG_DEV_PATH OPNFV_OSA_DEV_PATH OPNFV_BIFROST_DEV_PATH)
 for local_user_var in ${user_local_dev_vars[@]}; do
-    [[ -n ${!local_user_var} ]] && export $local_user_var=${!local_user_var%/}/
+    [[ -n ${!local_user_var:-} ]] && export $local_user_var=${!local_user_var%/}/
 done
 unset user_local_dev_vars local_user_var