Ignore ShellCheck rule SC2046
[releng/builder.git] / 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