From: Kefu Chai Date: Fri, 27 Sep 2019 02:26:54 +0000 (+0800) Subject: install-deps: do not install if rpm already installed X-Git-Tag: v12.2.13~109^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=459f878f88b764628afe9b3d2ded9325ccdea74e;p=ceph.git install-deps: do not install if rpm already installed 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 (cherry picked from commit 45a4173bcfe15a9bf56f6aeb6e6c35386a00d1c5) --- diff --git a/install-deps.sh b/install-deps.sh index d7b8a10e292..a0944f5101f 100755 --- a/install-deps.sh +++ b/install-deps.sh @@ -209,7 +209,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