From 4033c66071c99d6b28e97ef7dfc4fcb80bafe0d3 Mon Sep 17 00:00:00 2001 From: Karol Latecki Date: Fri, 29 Nov 2019 09:21:39 +0100 Subject: [PATCH] scripts/vagrant: do not treat SPDK_VAGRANT_DISTRO as array Dash and double dash ("-" and "--") getopts params are safely shifted using "shift" and "OPTIND". After that it's safe to concatenate param array to string using "$*", especially that there is only 1 positional parameter, which is distro version. Previous approach ("$@" as array) made "export" impossible and as a result VM was created with Fedora 28 distro on each run. Change-Id: I48fa588220f8b7f46c561d480ee32920847c7903 Signed-off-by: Karol Latecki Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/476128 Tested-by: SPDK CI Jenkins Reviewed-by: Shuhei Matsumoto Reviewed-by: Tomasz Zawadzki Reviewed-by: Maciej Wawryk Reviewed-by: Pawel Kaminski --- scripts/vagrant/create_vbox.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/vagrant/create_vbox.sh b/scripts/vagrant/create_vbox.sh index d8fde23de..f913c2013 100755 --- a/scripts/vagrant/create_vbox.sh +++ b/scripts/vagrant/create_vbox.sh @@ -130,9 +130,9 @@ done shift "$((OPTIND-1))" # Discard the options and sentinel -- -SPDK_VAGRANT_DISTRO=( "$@" ) +SPDK_VAGRANT_DISTRO="$*" -case "${SPDK_VAGRANT_DISTRO[0]}" in +case "${SPDK_VAGRANT_DISTRO}" in centos7) export SPDK_VAGRANT_DISTRO ;;