From 2e18ad459c0061c850f15c6cf9aa46e62c064c70 Mon Sep 17 00:00:00 2001 From: Michael Aldridge Date: Sun, 17 Sep 2017 17:19:30 -0700 Subject: [PATCH] [TRAVIS]: More reliable/comprehensive mirror set mechanism --- .travis.yml | 1 + common/travis/prepare.sh | 3 --- common/travis/set_mirror.sh | 15 +++++++++++++++ 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100755 common/travis/set_mirror.sh diff --git a/.travis.yml b/.travis.yml index 865e60ec2f8..455a72d44f4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,7 @@ env: - ARCH=aarch64-musl BOOTSTRAP=x86_64-musl before_script: + - common/travis/set_mirror.sh - common/travis/prepare.sh - common/travis/fetch_upstream.sh - common/travis/changed_templates.sh diff --git a/common/travis/prepare.sh b/common/travis/prepare.sh index 8022ab38da4..fafd93dfc48 100755 --- a/common/travis/prepare.sh +++ b/common/travis/prepare.sh @@ -21,6 +21,3 @@ wget -q -O - https://github.com/chneukirchen/xtools/archive/master.tar.gz | \ echo XBPS_CHROOT_CMD=uchroot >> etc/conf echo XBPS_MAKEJOBS=4 >> etc/conf echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf - -/bin/echo -e '\x1b[32mUpdating etc/repos-remote.conf...\x1b[0m' -sed -i 's#https\?://repo\.voidlinux\.eu#http://198.204.250.219#' etc/repos-remote.conf diff --git a/common/travis/set_mirror.sh b/common/travis/set_mirror.sh new file mode 100755 index 00000000000..5492ef08906 --- /dev/null +++ b/common/travis/set_mirror.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +TRAVIS_PROTO=http +TRAVIS_MIRROR=198.204.250.219 + +for _i in etc/repos-remote.conf etc/defaults.conf etc/repos-remote-x86_64.conf ; do + printf '\x1b[32mUpdating %s...\x1b[0m\n' $_i + # First fix the proto, ideally we'd serve everything with HTTPS, + # but key management and rotation is a pain, and things are signed + # so we can afford to be a little lazy at times. + sed -i "s:https:$TRAVIS_PROTO:g" $_i + + # Now set the mirro + sed -i "s:repo\.voidlinux\.eu:$TRAVIS_MIRROR:g" $_i +done