summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2020-04-28 08:58:44 +0200
committerAnoop C S <anoopcs@cryptolab.net>2020-04-28 14:51:42 +0530
commitfbe5622b11aa0ba2f7014884eb808926028907f8 (patch)
tree0533af7f52c5e88888d8f359fc8072b860eaae13
parent7a5a46a881d75483199846b479effd61d12dc9c1 (diff)
downloadsamba-integration-fbe5622b11aa0ba2f7014884eb808926028907f8.tar.gz
samba-integration-fbe5622b11aa0ba2f7014884eb808926028907f8.tar.xz
samba-integration-fbe5622b11aa0ba2f7014884eb808926028907f8.zip
centos-ci: streamline install of vagrant rpm
Avoid the slightly confusing stance `yum install || yum update`. Instead, use rpm -q to check for the desired RPM version. Signed-off-by: Michael Adam <obnox@samba.org>
-rwxr-xr-xsamba-integration-centos-ci-tests.sh18
1 files changed, 9 insertions, 9 deletions
diff --git a/samba-integration-centos-ci-tests.sh b/samba-integration-centos-ci-tests.sh
index e49a0aa..e34380a 100755
--- a/samba-integration-centos-ci-tests.sh
+++ b/samba-integration-centos-ci-tests.sh
@@ -86,16 +86,16 @@ yum -y install \
# "vagrant plugin install"
yum -y group install "Development Tools"
-# download the vagrant RPM
+# yum install fails if the package is already installed at the desired
+# version, so we check whether vagrant is already installed at that
+# version. This is important to check when the script is invoked a
+# couple of times in a row to prevent it from failing. As a positive
+# side effect, it also avoids duplicate downloads of the RPM.
#
-curl -O -# https://releases.hashicorp.com/vagrant/2.2.7/vagrant_2.2.7_x86_64.rpm
-
-# yum install fails if the package is already installed and updated to the
-# latest version. The pattern of (install || update) is a trick to prevent
-# installation from failing when we have entered the script for the second time.
-# It may look a bit weird, but is the easiest way I found to make sure
-# we install the package and have it at the desired version.
-yum -y install ./vagrant_2.2.7_x86_64.rpm || yum -y update ./vagrant_2.2.7_x86_64.rpm
+if ! rpm -q vagrant-2.2.7
+then
+ yum -y install https://releases.hashicorp.com/vagrant/2.2.7/vagrant_2.2.7_x86_64.rpm
+fi
vagrant plugin install vagrant-libvirt