Ignore ShellCheck rule SC2046 55/53055/1
authorThanh Ha <thanh.ha@linuxfoundation.org>
Thu, 9 Mar 2017 06:22:46 +0000 (01:22 -0500)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Thu, 9 Mar 2017 06:23:30 +0000 (01:23 -0500)
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 <thanh.ha@linuxfoundation.org>
packer/provision/baseline.sh

index 38b6ac2e066102d4e41fa7d7ddcedbf33217a6f9..3841b20210fc58ecc8eb651b5ca47e5e35893d4a 100644 (file)
@@ -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