From 6d9dd04de2ec9df7f14564945e7de9bdb78cd77d Mon Sep 17 00:00:00 2001 From: Will Roden Date: Mon, 25 Jan 2021 13:10:16 -0600 Subject: [PATCH] don't HEAD downloads now that we are filtering out precise versions --- src/head-go-version | 28 ---------------------------- src/resolve-go-version | 15 --------------- src/resolve-go-version_test.sh | 24 ------------------------ 3 files changed, 67 deletions(-) delete mode 100755 src/head-go-version diff --git a/src/head-go-version b/src/head-go-version deleted file mode 100755 index 7767486..0000000 --- a/src/head-go-version +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -set -e -[ -n "$DEBUG" ] && set -x - -CDPATH="" cd -- "$(dirname -- "$(dirname -- "$0")")" - -. src/lib - -debug_out starting head-go-version - -version="$1" - -mock_head_go_version="${mock_head_go_version:-""}" -if [ -n "$mock_head_go_version" ]; then - available_head_versions="${available_head_versions:-""}" - for ver in $available_head_versions; do - if [ "$ver" = "$version" ]; then - exit 0 - fi - done - exit 1 -fi - -. src/lib - -check_url="$(download_go_url "$version")" -curl -IL --fail -s "$check_url" >/dev/null diff --git a/src/resolve-go-version b/src/resolve-go-version index 4340dcb..a5c92dd 100755 --- a/src/resolve-go-version +++ b/src/resolve-go-version @@ -44,21 +44,6 @@ if [ -z "$IGNORE_LOCAL_GO" ]; then done fi -head_go_version="${head_go_version:-"./src/head-go-version"}" - -# if the exact version is available to download, use it -if "$head_go_version" "$GO_VERSION_CONSTRAINT" ; then - echo "$GO_VERSION_CONSTRAINT" - exit -fi - -## if the exact version is available to download, use it -#check_url="$(download_go_url "$GO_VERSION_CONSTRAINT")" -#if curl -IL --fail -s "$check_url" >/dev/null; then -# echo "$GO_VERSION_CONSTRAINT" -# exit -#fi - if [ -z "$IGNORE_LOCAL_GO" ]; then set +e local_matches="$(echo "$local_versions" | "$action_dir/third_party/sh-semver/semver.sh" -r "$GO_VERSION_CONSTRAINT")" diff --git a/src/resolve-go-version_test.sh b/src/resolve-go-version_test.sh index f35c58a..c1bae75 100755 --- a/src/resolve-go-version_test.sh +++ b/src/resolve-go-version_test.sh @@ -38,23 +38,6 @@ oneTimeSetUp() { done } -available_head_versions='' - -mock_version_available_to_dl() { - v="$1" - for ver in $available_head_versions ; do - if [ "$ver" = "$v" ]; then - return 0 - fi - done - return 1 -} - -mock_head_versions() { - export available_head_versions="$1" - export mock_head_go_version="1" -} - test_version() { export dl_json="$ex_dl_json" tmpdir="$SHUNIT_TMPDIR/${FUNCNAME[0]}" @@ -62,8 +45,6 @@ test_version() { mkdir -p "$toolcache" touch "$toolcache/1.14.2" touch "$toolcache/1.15.6" - mock_head_versions '1.15 -1.15beta1' tests='*;1.15.6 1.15;1.15 @@ -81,7 +62,6 @@ tip;tip done } - test_version_ignore_local_go() { export dl_json="$ex_dl_json" tmpdir="$SHUNIT_TMPDIR/${FUNCNAME[0]}" @@ -89,10 +69,6 @@ test_version_ignore_local_go() { mkdir -p "$toolcache" touch "$toolcache/1.14.2" touch "$toolcache/1.15.6" - mock_head_versions '1.15 -1.15beta1' - - export version_available_to_dl_func="mock_version_available_to_dl" tests='*;1.15.7 1.15;1.15