]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
install-deps.sh: add EPEL repo for non-x86_64 archs as well 30601/head
authorNathan Cutler <ncutler@suse.com>
Tue, 24 Sep 2019 19:48:27 +0000 (21:48 +0200)
committerNathan Cutler <ncutler@suse.com>
Wed, 2 Oct 2019 10:53:55 +0000 (12:53 +0200)
Fixes: https://tracker.ceph.com/issues/42023
Signed-off-by: Kefu Chai <kchai@redhat.com>
Signed-off-by: Nathan Cutler <ncutler@suse.com>
(cherry picked from commit 49d740118f9a0ee6b6bb82954630c654946f1751)

install-deps.sh

index 27d6c25147147d626454c203aa52da0fd189632e..a184137514baa7bfcb4beedf17ba973871d8a333 100755 (executable)
@@ -100,7 +100,7 @@ ENDOFKEY
        $SUDO env DEBIAN_FRONTEND=noninteractive apt-get install -y g++-7
     fi
 
-    case $codename in
+    case "$codename" in
         trusty)
             old=4.8;;
         xenial)
@@ -120,8 +120,8 @@ ENDOFKEY
     $SUDO update-alternatives --auto gcc
 
     # cmake uses the latter by default
-    $SUDO ln -nsf /usr/bin/gcc /usr/bin/$(uname -m)-linux-gnu-gcc
-    $SUDO ln -nsf /usr/bin/g++ /usr/bin/$(uname -m)-linux-gnu-g++
+    $SUDO ln -nsf /usr/bin/gcc /usr/bin/${ARCH}-linux-gnu-gcc
+    $SUDO ln -nsf /usr/bin/g++ /usr/bin/${ARCH}-linux-gnu-g++
 }
 
 function install_pkg_on_ubuntu {
@@ -267,7 +267,7 @@ else
         for_make_check=false
     fi
     source /etc/os-release
-    case $ID in
+    case "$ID" in
     debian|ubuntu|devuan)
         echo "Using apt-get to install dependencies"
         $SUDO apt-get install -y devscripts equivs
@@ -318,12 +318,12 @@ else
             builddepcmd="dnf -y builddep --allowerasing"
         fi
         echo "Using $yumdnf to install dependencies"
-       if [ "$ID" = "centos" -a $(uname -m) = aarch64 ]; then
+       if [ "$ID" = "centos" -a "$ARCH" = "aarch64" ]; then
            $SUDO yum-config-manager --disable centos-sclo-sclo || true
            $SUDO yum-config-manager --disable centos-sclo-rh || true
            $SUDO yum remove centos-release-scl || true
        fi
-        case $ID in
+        case "$ID" in
             fedora)
                 if test $yumdnf = yum; then
                     $SUDO $yumdnf install -y yum-utils
@@ -335,13 +335,12 @@ else
                 if test $ID = rhel ; then
                     $SUDO yum-config-manager --enable rhel-$MAJOR_VERSION-server-optional-rpms
                 fi
-                $SUDO yum-config-manager --add-repo https://dl.fedoraproject.org/pub/epel/$MAJOR_VERSION/x86_64/
-                $SUDO yum install --nogpgcheck -y epel-release
+                $SUDO yum install --nogpgcheck https://dl.fedoraproject.org/pub/epel/epel-release-latest-$MAJOR_VERSION.noarch.rpm
                 $SUDO rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-$MAJOR_VERSION
                 $SUDO rm -f /etc/yum.repos.d/dl.fedoraproject.org*
                 if test $ID = centos -a $MAJOR_VERSION = 7 ; then
                    $SUDO $yumdnf install -y python36-devel
-                   case $(uname -m) in
+                   case "$ARCH" in
                        x86_64)
                            $SUDO yum -y install centos-release-scl
                            dts_ver=7