The use of yum triggers a warning and reference to yum2dnf on Fedora >= 22.
Use either yum or dnf based on the Fedora version.
Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
if [ -n "$backports" ] ; then rm $control; fi
;;
centos|fedora|rhel)
- echo "Using yum to install dependencies"
- $SUDO yum install -y redhat-lsb-core
+ yumdnf="yum"
+ builddepcmd="yum-builddep -y"
+ if test "$(echo "$VERSION_ID >= 22" | bc)" -ne 0; then
+ yumdnf="dnf"
+ builddepcmd="dnf -y builddep --allowerasing"
+ fi
+ echo "Using $yumdnf to install dependencies"
+ $SUDO $yumdnf install -y redhat-lsb-core
case $(lsb_release -si) in
Fedora)
- $SUDO yum install -y yum-utils
+ if test $yumdnf = yum; then
+ $SUDO $yumdnf install -y yum-utils
+ fi
;;
CentOS|RedHatEnterpriseServer)
$SUDO yum install -y yum-utils
;;
esac
sed -e 's/@//g' < ceph.spec.in > $DIR/ceph.spec
- $SUDO yum-builddep -y $DIR/ceph.spec 2>&1 | tee $DIR/yum-builddep.out
+ $SUDO $builddepcmd $DIR/ceph.spec 2>&1 | tee $DIR/yum-builddep.out
! grep -q -i error: $DIR/yum-builddep.out || exit 1
;;
opensuse|suse)
CHECK_MAKEOPTS=${CHECK_MAKEOPTS:-$DEFAULT_MAKEOPTS}
function run() {
- # Same logic as install-deps.sh for finding package installer
local install_cmd
- test -f /etc/redhat-release && install_cmd="yum install -y"
+ if test -f /etc/redhat-release ; then
+ source /etc/os-release
+ if test "$(echo "$VERSION_ID >= 22" | bc)" -ne 0; then
+ install_cmd="dnf -y install"
+ else
+ install_cmd="yum install -y"
+ fi
+ fi
+
type apt-get > /dev/null 2>&1 && install_cmd="apt-get install -y"
type zypper > /dev/null 2>&1 && install_cmd="zypper --gpg-auto-import-keys --non-interactive install"
if [ -n "$install_cmd" ]; then
fi
function run() {
- # Same logic as install-deps.sh for finding package installer
local install_cmd
- test -f /etc/redhat-release && install_cmd="yum install -y"
+ if test -f /etc/redhat-release ; then
+ source /etc/os-release
+ if test "$(echo "$VERSION_ID >= 22" | bc)" -ne 0; then
+ install_cmd="dnf -y install"
+ else
+ install_cmd="yum install -y"
+ fi
+ fi
+
type apt-get > /dev/null 2>&1 && install_cmd="apt-get install -y"
type zypper > /dev/null 2>&1 && install_cmd="zypper --gpg-auto-import-keys --non-interactive install"
if [ -n "$install_cmd" ]; then