From 5ea4e7a066932ce8d12aa97b4192fddc297fc7fb Mon Sep 17 00:00:00 2001 From: Pavlo Shchelokovskyy Date: Tue, 6 Dec 2016 14:06:47 +0000 Subject: [PATCH] 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 --- releasenotes/notes/dnf-support-413762b0af2887bc.yaml | 5 +++++ scripts/install-deps.sh | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/dnf-support-413762b0af2887bc.yaml diff --git a/releasenotes/notes/dnf-support-413762b0af2887bc.yaml b/releasenotes/notes/dnf-support-413762b0af2887bc.yaml new file mode 100644 index 000000000..414c90e84 --- /dev/null +++ b/releasenotes/notes/dnf-support-413762b0af2887bc.yaml @@ -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. diff --git a/scripts/install-deps.sh b/scripts/install-deps.sh index a2fdd158e..82813e7f9 100644 --- a/scripts/install-deps.sh +++ b/scripts/install-deps.sh @@ -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