Add support for dnf as package manager

try to use it first and fall back to yum when not present.

Change-Id: I0001eb4b5ac2ea6deedef9548b2f51cd1adc38f3
Closes-Bug: #1585758
This commit is contained in:
Pavlo Shchelokovskyy 2016-12-06 14:06:47 +00:00
parent eb727f4a01
commit 5ea4e7a066
2 changed files with 8 additions and 2 deletions

View File

@ -0,0 +1,5 @@
---
features:
- bifrost now supports ``dnf`` as package manager on RedHat-based distros.
It tries to use it by default and falls back to ``yum`` when ``dnf`` is
not available.

View File

@ -48,9 +48,10 @@ elif [ -x '/usr/bin/apt-get' ]; then
[wget]=wget
)
EXTRA_PKG_DEPS=()
elif [ -x '/usr/bin/yum' ]; then
elif [ -x '/usr/bin/dnf' ] || [ -x '/usr/bin/yum' ]; then
OS_FAMILY="RedHat"
INSTALLER_CMD="sudo -H yum -y install"
PKG_MANAGER=$(which dnf || which yum)
INSTALLER_CMD="sudo -H ${PKG_MANAGER} -y install"
CHECK_CMD="rpm -q"
PKG_MAP=(
[gcc]=gcc