From a045ae18ed8c148905f8ae4970efe75483497d7d Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Fri, 10 Oct 2014 15:27:58 -0300 Subject: [PATCH] Avoid CentOS downloading stuff from random mirrors --- vagrant/centos.sh | 8 ++++++++ 1 file changed, 8 insertions(+), 0 deletions(-) diff --git a/vagrant/centos.sh b/vagrant/centos.sh index a3fadfd..81a6e90 100644 --- a/vagrant/centos.sh +++ b/vagrant/centos.sh @@ -21,6 +21,14 @@ if [ ! -f /etc/yum.repos.d/puias-6-computational.repo ]; then yum install springdale-computational -y fi +if [ -n "$http_proxy" ]; then + # force all repositories to always use the same host to take advantage of a + # local proxy + repos=$(grep -rl '^#baseurl' /etc/yum.repos.d) + if [ -n "$repos" ]; then + sed -i -e 's/^#baseurl/baseurl/; s/^mirrorlist=/#mirrorlist-/' $repos + fi +fi ### Install dependencies -- libgit2 0.21.2