Merge "Workaround for a dnf bug"

This commit is contained in:
Zuul 2019-01-24 09:37:26 +00:00 committed by Gerrit Code Review
commit d0664582ee

View File

@ -314,10 +314,9 @@ else
# fedora/centos/rhel # fedora/centos/rhel
# Actual qemu-img name may be qemu-img, qemu-img-ev, qemu-img-rhev, ... # Actual qemu-img name may be qemu-img, qemu-img-ev, qemu-img-rhev, ...
# "dnf|yum install qemu-img" works for all, but search requires wildcard # "dnf|yum install qemu-img" works for all, but search requires wildcard
PKG_MGR=$(which dnf &>/dev/null && echo dnf || echo yum)
PKG_LIST="qemu-img* git" PKG_LIST="qemu-img* git"
for pkg in $PKG_LIST; do for pkg in $PKG_LIST; do
if ! $PKG_MGR info installed $pkg &> /dev/null; then if ! rpm -qa $pkg ; then
echo "Required package " ${pkg/\*} " is not installed. Exiting." echo "Required package " ${pkg/\*} " is not installed. Exiting."
exit 1 exit 1
fi fi