Add ability to build amp image on SUSE

SUSE distros need to use rpm to check for
existance of packages and the check on
qemu-img fails with the current script.

Change-Id: Ieffba6714852eabbb7b6b6da5090d10ed904998c
Closes-bug: 1707310
This commit is contained in:
Adolfo Duarte 2017-07-28 15:45:58 -07:00 committed by Swaminathan Vasudevan
parent 6c1d424776
commit 404e8ad63a

View File

@ -266,7 +266,16 @@ if [ "$platform" = 'NAME="Ubuntu"' ]; then
echo "Earlier versions don't support the extended attributes required."
exit 1
fi
elif [[ $platform =~ "SUSE" ]]; then
# OpenSUSE
# use rpm -q to check for qemu-tools and git-core
PKG_LIST="qemu-tools git-core"
for pkg in $PKG_LIST; do
if ! rpm -q $pkg &> /dev/null; then
echo "Required package " ${pkg/\*} " is not installed. Exiting."
exit 1
fi
done
else
# fedora/centos/rhel
# Actual qemu-img name may be qemu-img, qemu-img-ev, qemu-img-rhev, ...