From: YAMAMOTO Takashi Date: Wed, 14 Oct 2015 06:36:20 +0000 (+0000) Subject: completion.at: Improve portability X-Git-Tag: v2.5.0~266 X-Git-Url: http://git.cascardo.eti.br/?a=commitdiff_plain;h=622aff9668176cec0fde985928b863e871c42831;p=cascardo%2Fovs.git completion.at: Improve portability NetBSD's /bin/sh complains on the syntax of bash array. While the use of eval might seem overkill, it's tricky to avoid the error because the generated code will be a part of the surrounding subshell and the syntax check is done a bit earlier than the execution of these conditionals. Signed-off-by: YAMAMOTO Takashi Acked-by: Ben Pfaff --- diff --git a/tests/completion.at b/tests/completion.at index 0aca7aabb..79093f9b6 100644 --- a/tests/completion.at +++ b/tests/completion.at @@ -341,7 +341,8 @@ echo "$@" | tr ' ' '\n' | sed -e '/^$/d' | sed -e 's/$/ /g' | sort -u ]) AT_SETUP([vsctl-bashcomp - basic verification]) -AT_SKIP_IF([test -z ${BASH_VERSION+x} || test ${BASH_VERSINFO[[0]]} -lt 4]) +AT_SKIP_IF([test -z ${BASH_VERSION+x}]) +AT_SKIP_IF([eval 'test ${BASH_VERSINFO[[0]]} -lt 4']) OVS_VSWITCHD_START # complete ovs-vsctl --db=* [TAB] @@ -422,7 +423,8 @@ AT_CLEANUP AT_SETUP([vsctl-bashcomp - argument completion]) -AT_SKIP_IF([test -z ${BASH_VERSION+x} || test ${BASH_VERSINFO[[0]]} -lt 4]) +AT_SKIP_IF([test -z ${BASH_VERSION+x}]) +AT_SKIP_IF([eval 'test ${BASH_VERSINFO[[0]]} -lt 4']) OVS_VSWITCHD_START( [add-br br1 -- \ set bridge br1 datapath-type=dummy -- \ @@ -748,7 +750,8 @@ AT_CLEANUP AT_SETUP([vsctl-bashcomp - negative test]) -AT_SKIP_IF([test -z ${BASH_VERSION+x} || test ${BASH_VERSINFO[[0]]} -lt 4]) +AT_SKIP_IF([test -z ${BASH_VERSION+x}]) +AT_SKIP_IF([eval 'test ${BASH_VERSINFO[[0]]} -lt 4']) OVS_VSWITCHD_START # complete non-matching command. @@ -786,4 +789,4 @@ OVS_VSWITCHD_STOP AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test ""], [1], []) -AT_CLEANUP \ No newline at end of file +AT_CLEANUP