Default channel=LTS

Clarify nomenclature from "alternate" to "legacy"
Skip construction of legacy URL if it's flawed.
This commit is contained in:
John Beisner 2017-06-09 12:00:29 -07:00
parent 07b93e9d7c
commit cd753db228
2 changed files with 31 additions and 23 deletions

View file

@ -147,7 +147,7 @@ get_distro_specific_os_name() {
fi
fi
say_err "OS name could not be detected: $ID.$VERSION_ID"
say_verbose "Distribution specific OS name + version could not be detected: $ID.$VERSION_ID"
return 1
}
@ -412,7 +412,7 @@ construct_download_link() {
# channel - $2
# normalized_architecture - $3
# specific_version - $4
construct_alt_download_link() {
construct_legacy_download_link() {
eval $invocation
local azure_feed=$1
@ -423,14 +423,14 @@ construct_alt_download_link() {
local distro_specific_osname
distro_specific_osname=$(get_distro_specific_os_name) || return 1
local alt_download_link=null
local legacy_download_link=null
if [ "$shared_runtime" = true ]; then
alt_download_link="$azure_feed/Runtime/$specific_version/dotnet-$distro_specific_osname-$normalized_architecture.$specific_version.tar.gz"
legacy_download_link="$azure_feed/Runtime/$specific_version/dotnet-$distro_specific_osname-$normalized_architecture.$specific_version.tar.gz"
else
alt_download_link="$azure_feed/Sdk/$specific_version/dotnet-dev-$distro_specific_osname-$normalized_architecture.$specific_version.tar.gz"
legacy_download_link="$azure_feed/Sdk/$specific_version/dotnet-dev-$distro_specific_osname-$normalized_architecture.$specific_version.tar.gz"
fi
echo "$alt_download_link"
echo "$legacy_download_link"
return 0
}
@ -601,7 +601,8 @@ downloadwget() {
calculate_vars() {
eval $invocation
valid_legacy_download_link=false
normalized_architecture=$(get_normalized_architecture_from_architecture "$architecture")
say_verbose "normalized_architecture=$normalized_architecture"
@ -615,8 +616,12 @@ calculate_vars() {
download_link=$(construct_download_link $azure_feed $channel $normalized_architecture $specific_version)
say_verbose "download_link=$download_link"
alt_download_link=$(construct_alt_download_link $azure_feed $channel $normalized_architecture $specific_version)
say_verbose "alt_download_link=$alt_download_link"
if [ legacy_download_link=$(construct_legacy_download_link $azure_feed $channel $normalized_architecture $specific_version) ]; then
say_verbose "legacy_download_link=$legacy_download_link"
valid_legacy_download_link=true
else
say_verbose "Cound not construct a legacy_download_link; omitting..."
fi
install_root=$(resolve_installation_path $install_dir)
say_verbose "install_root=$install_root"
@ -638,13 +643,13 @@ install_dotnet() {
say "Downloading link: $download_link"
download "$download_link" $zip_path || download_failed=true
# if the download fails, download the alt_download_link
if [ "$download_failed" = true ]; then
# if the download fails, download the legacy_download_link
if [ "$download_failed" = true && "$valid_legacy_download_link" = true ]; then
say "Cannot download: $download_link"
zip_path=$(mktemp $temporary_file_template)
say_verbose "Alternate zip path: $zip_path"
say "Downloading alternate link: $alt_download_link"
download "$alt_download_link" $zip_path
say_verbose "Legacy zip path: $zip_path"
say "Downloading legacy link: $legacy_download_link"
download "$legacy_download_link" $zip_path
fi
say "Extracting zip"
@ -657,7 +662,7 @@ local_version_file_relative_path="/.version"
bin_folder_relative_path=""
temporary_file_template="${TMPDIR:-/tmp}/dotnet.XXXXXXXXX"
channel="release/1.0.0"
channel="LTS"
version="Latest"
install_dir="<auto>"
architecture="<auto>"
@ -764,9 +769,12 @@ done
check_min_reqs
calculate_vars
if [ "$dry_run" = true ]; then
say "Payload URL: $download_link"
say "Alternate payload URL: $alt_download_link"
if [ "$valid_legacy_download_link" = true ]; then
say "Legacy payload URL: $legacy_download_link"
fi
say "Repeatable invocation: ./$(basename $0) --version $specific_version --channel $channel --install-dir $install_dir"
exit 0
fi