Merge "Look for all qemu-img/kvm package names in rhel-based distros"

This commit is contained in:
Jenkins 2017-03-23 08:20:04 +00:00 committed by Gerrit Code Review
commit dfef65e0f2
1 changed files with 8 additions and 8 deletions

View File

@ -258,7 +258,7 @@ if [ "$platform" = 'NAME="Ubuntu"' ]; then
elif [ "$platform" = 'NAME=Fedora' ]; then elif [ "$platform" = 'NAME=Fedora' ]; then
PKG_LIST="qemu kpartx git" PKG_LIST="qemu kpartx git"
for pkg in $PKG_LIST; do for pkg in $PKG_LIST; do
if ! yum list installed $pkg &> /dev/null; then if ! yum info installed $pkg &> /dev/null; then
echo "Required package " $pkg " is not installed. Exiting." echo "Required package " $pkg " is not installed. Exiting."
exit 1 exit 1
fi fi
@ -267,16 +267,16 @@ else
# centos or rhel # centos or rhel
PKG_LIST="qemu-kvm qemu-img" PKG_LIST="qemu-kvm qemu-img"
for pkg in $PKG_LIST; do for pkg in $PKG_LIST; do
if ! yum list installed $pkg &> /dev/null; then # Actual name may be qemu-img, qemu-img-ev, qemu-img-rhev, ...
if ! yum list installed $pkg"-ev" &> /dev/null; then # "yum install qemu-img" works for all, but search requires wildcard
echo "Required package " $pkg " or " $pkg"-ev" " is not installed. Exiting." if ! yum info installed ${pkg}* &> /dev/null; then
exit 1 echo "Required package " $pkg " is not installed. Exiting."
fi exit 1
fi fi
done done
PKG_LIST="kpartx git" PKG_LIST="kpartx git"
for pkg in $PKG_LIST; do for pkg in $PKG_LIST; do
if ! yum list installed $pkg &> /dev/null; then if ! yum info installed $pkg &> /dev/null; then
echo "Required package " $pkg " is not installed. Exiting." echo "Required package " $pkg " is not installed. Exiting."
exit 1 exit 1
fi fi
@ -285,7 +285,7 @@ else
if [ ${platform:0:6} = "CentOS" ]; then if [ ${platform:0:6} = "CentOS" ]; then
# install EPEL repo, in order to install argparse # install EPEL repo, in order to install argparse
PKG_LIST="python-argparse" PKG_LIST="python-argparse"
if ! yum list installed $pkg &> /dev/null; then if ! yum info installed $pkg &> /dev/null; then
echo "CentOS requires the python-argparse package be " echo "CentOS requires the python-argparse package be "
echo "installed separately from the EPEL repo." echo "installed separately from the EPEL repo."
echo "Required package " $pkg " is not installed. Exiting." echo "Required package " $pkg " is not installed. Exiting."