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>
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