]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
install-deps: do not install if rpm already installed
authorKefu Chai <kchai@redhat.com>
Fri, 27 Sep 2019 02:26:54 +0000 (10:26 +0800)
committerNathan Cutler <ncutler@suse.com>
Thu, 3 Oct 2019 13:44:41 +0000 (15:44 +0200)
there is chance that the system already have epel-release-latest-7.noarch.rpm
installed, in that case, install-deps.sh should not fail.

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 45a4173bcfe15a9bf56f6aeb6e6c35386a00d1c5)

install-deps.sh

index a184137514baa7bfcb4beedf17ba973871d8a333..c7a35a1b80125fdc24ef5f563605195ba79c1411 100755 (executable)
@@ -335,7 +335,8 @@ else
                 if test $ID = rhel ; then
                     $SUDO yum-config-manager --enable rhel-$MAJOR_VERSION-server-optional-rpms
                 fi
-                $SUDO yum install --nogpgcheck https://dl.fedoraproject.org/pub/epel/epel-release-latest-$MAJOR_VERSION.noarch.rpm
+                rpm --quiet --query epel-release || \
+                   $SUDO yum -y 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