From: Thanh Ha Date: Thu, 9 Mar 2017 06:22:46 +0000 (-0500) Subject: Ignore ShellCheck rule SC2046 X-Git-Tag: release/boron-sr3~111 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=d1398e5bbc5991f4f9fec785931333a278f0361e;p=releng%2Fbuilder.git Ignore ShellCheck rule SC2046 Not sure how to resolve this at the moment. If we quote it as suggested the check fails and compare with -eq 0. Ignore this ShellCheck for now until we figure out a proper solution. Change-Id: I4b14d3db442a2cba8020b4823ef8c5b87ce5ccea Signed-off-by: Thanh Ha --- diff --git a/packer/provision/baseline.sh b/packer/provision/baseline.sh index 38b6ac2e0..3841b2021 100644 --- a/packer/provision/baseline.sh +++ b/packer/provision/baseline.sh @@ -157,7 +157,8 @@ EOF for pkg in unzip xz-utils puppet git git-review libxml-xpath-perl do - if dpkg-query -W -f='${Status}' $pkg 2>/dev/null | grep -c "ok installed"; then + # shellcheck disable=SC2046 + if [ $(dpkg-query -W -f='${Status}' $pkg 2>/dev/null | grep -c "ok installed") -eq 0 ]; then apt-get install $pkg fi done