From 53fff83811ae591a54060dc9e9d8be37882ab6dd Mon Sep 17 00:00:00 2001 From: Marin Date: Tue, 8 Jul 2014 20:03:34 -0700 Subject: [PATCH] fall back to google code if http://golang.org/dl (newer versions) fails, try to download from google code. --- scripts/install | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/scripts/install b/scripts/install index eb04aca..14c78f9 100755 --- a/scripts/install +++ b/scripts/install @@ -170,17 +170,24 @@ download_binary() { fi GO_BINARY_FILE=${VERSION}.${GVM_OS}-${GVM_ARCH}${GVM_OS_VERSION}.tar.gz - GO_BINARY_URL="https://go.googlecode.com/files/go${GO_BINARY_FILE}" + GO_BINARY_URL="http://golang.org/dl/go${GO_BINARY_FILE}" GO_BINARY_PATH=${GVM_ROOT}/archive/${GO_BINARY_FILE} if [ ! -f $GO_BINARY_PATH ]; then curl -s -f -L $GO_BINARY_URL > ${GO_BINARY_PATH} if [[ $? -ne 0 ]]; then - display_error "Failed to download binary go" - rm -rf $GO_INSTALL_ROOT - rm -f $GO_BINARY_PATH - exit 1 + display_error "Failed to download binary go from http://golang.org. Trying https://go.googlecode.com" + GO_BINARY_URL="https://go.googlecode.com/files/go${GO_BINARY_FILE}" + + curl -s -f -L $GO_BINARY_URL > ${GO_BINARY_PATH} + + if [[ $? -ne 0 ]]; then + display_error "Failed to download binary go" + rm -rf $GO_INSTALL_ROOT + rm -f $GO_BINARY_PATH + exit 1 + fi fi fi