Merge "Support DNF package manager in diskimage-create"

This commit is contained in:
Zuul 2018-09-15 00:46:10 +00:00 committed by Gerrit Code Review
commit 182c942b5d
1 changed files with 3 additions and 2 deletions

View File

@ -298,10 +298,11 @@ elif [[ $platform =~ "SUSE" ]]; then
else
# fedora/centos/rhel
# Actual qemu-img name may be qemu-img, qemu-img-ev, qemu-img-rhev, ...
# "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"
for pkg in $PKG_LIST; do
if ! yum info installed $pkg &> /dev/null; then
if ! $PKG_MGR info installed $pkg &> /dev/null; then
echo "Required package " ${pkg/\*} " is not installed. Exiting."
exit 1
fi