From 404e8ad63a3841c5a0cf930c5984971ab26e6c41 Mon Sep 17 00:00:00 2001 From: Adolfo Duarte Date: Fri, 28 Jul 2017 15:45:58 -0700 Subject: [PATCH] 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 --- diskimage-create/diskimage-create.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/diskimage-create/diskimage-create.sh b/diskimage-create/diskimage-create.sh index 9206e18c04..d7b04453ed 100755 --- a/diskimage-create/diskimage-create.sh +++ b/diskimage-create/diskimage-create.sh @@ -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, ...