]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
build scripts: Enable dnf for Fedora >= 22
authorBrad Hubbard <bhubbard@redhat.com>
Fri, 16 Sep 2016 04:29:15 +0000 (14:29 +1000)
committerBrad Hubbard <bhubbard@redhat.com>
Fri, 16 Sep 2016 08:59:59 +0000 (18:59 +1000)
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>
install-deps.sh
run-cmake-check.sh
run-make-check.sh

index b1e1636c0485f785375b86552ccd76cdb6d61fd4..96d66219e06575d52412f6b0686dd70ed5043c30 100755 (executable)
@@ -85,11 +85,19 @@ else
        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
@@ -108,7 +116,7 @@ else
                 ;;
         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)
index 8f95eacd68cf1f43fe8ca0992b774a7c33df13b1..52b83ab7e191f48989f60ba46a978fee0f7bf423 100755 (executable)
@@ -32,9 +32,16 @@ BUILD_MAKEOPTS=${BUILD_MAKEOPTS:-$DEFAULT_MAKEOPTS}
 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
index 05230adfd5e35925bdcdcd49ac3b6b828e388e3a..c6c49cff410706de6c259c03ba52ef6c4716fdb3 100755 (executable)
@@ -50,9 +50,16 @@ else
 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