Commit a045ae18ed8c148905f8ae4970efe75483497d7d
Committed by
Sergio Oliveira
1 parent
c034d62c
Exists in
master
and in
39 other branches
Avoid CentOS downloading stuff from random mirrors
this completely breaks any attempt of using a HTTP proxy.
Showing
1 changed file
with
8 additions
and
0 deletions
Show diff stats
vagrant/centos.sh
@@ -21,6 +21,14 @@ if [ ! -f /etc/yum.repos.d/puias-6-computational.repo ]; then | @@ -21,6 +21,14 @@ if [ ! -f /etc/yum.repos.d/puias-6-computational.repo ]; then | ||
21 | yum install springdale-computational -y | 21 | yum install springdale-computational -y |
22 | fi | 22 | fi |
23 | 23 | ||
24 | +if [ -n "$http_proxy" ]; then | ||
25 | + # force all repositories to always use the same host to take advantage of a | ||
26 | + # local proxy | ||
27 | + repos=$(grep -rl '^#baseurl' /etc/yum.repos.d) | ||
28 | + if [ -n "$repos" ]; then | ||
29 | + sed -i -e 's/^#baseurl/baseurl/; s/^mirrorlist=/#mirrorlist-/' $repos | ||
30 | + fi | ||
31 | +fi | ||
24 | 32 | ||
25 | ### Install dependencies | 33 | ### Install dependencies |
26 | 34 |