Merge pull request #6839 from johnbeisner/UpdateChannels
Updating the default channel; legacy URL construction
This commit is contained in:
commit
3a5612f153
2 changed files with 32 additions and 23 deletions
14
scripts/obtain/dotnet-install.ps1
vendored
14
scripts/obtain/dotnet-install.ps1
vendored
|
@ -10,7 +10,7 @@
|
||||||
Installs dotnet cli. If dotnet installation already exists in the given directory
|
Installs dotnet cli. If dotnet installation already exists in the given directory
|
||||||
it will update it only if the requested version differs from the one already installed.
|
it will update it only if the requested version differs from the one already installed.
|
||||||
.PARAMETER Channel
|
.PARAMETER Channel
|
||||||
Default: release/1.0.0
|
Default: LTS
|
||||||
Download from the Channel specified
|
Download from the Channel specified
|
||||||
.PARAMETER Version
|
.PARAMETER Version
|
||||||
Default: latest
|
Default: latest
|
||||||
|
@ -55,7 +55,7 @@
|
||||||
#>
|
#>
|
||||||
[cmdletbinding()]
|
[cmdletbinding()]
|
||||||
param(
|
param(
|
||||||
[string]$Channel="release/1.0.0",
|
[string]$Channel="LTS",
|
||||||
[string]$Version="Latest",
|
[string]$Version="Latest",
|
||||||
[string]$InstallDir="<auto>",
|
[string]$InstallDir="<auto>",
|
||||||
[string]$Architecture="<auto>",
|
[string]$Architecture="<auto>",
|
||||||
|
@ -261,7 +261,7 @@ function Get-Download-Link([string]$AzureFeed, [string]$Channel, [string]$Specif
|
||||||
return $PayloadURL
|
return $PayloadURL
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-AltDownload-Link([string]$AzureFeed, [string]$Channel, [string]$SpecificVersion, [string]$CLIArchitecture) {
|
function Get-LegacyDownload-Link([string]$AzureFeed, [string]$Channel, [string]$SpecificVersion, [string]$CLIArchitecture) {
|
||||||
Say-Invocation $MyInvocation
|
Say-Invocation $MyInvocation
|
||||||
|
|
||||||
if ($SharedRuntime) {
|
if ($SharedRuntime) {
|
||||||
|
@ -271,7 +271,7 @@ function Get-AltDownload-Link([string]$AzureFeed, [string]$Channel, [string]$Spe
|
||||||
$PayloadURL = "$AzureFeed/Sdk/$SpecificVersion/dotnet-dev-win-$CLIArchitecture.$SpecificVersion.zip"
|
$PayloadURL = "$AzureFeed/Sdk/$SpecificVersion/dotnet-dev-win-$CLIArchitecture.$SpecificVersion.zip"
|
||||||
}
|
}
|
||||||
|
|
||||||
Say-Verbose "Constructed alternate payload URL: $PayloadURL"
|
Say-Verbose "Constructed legacy payload URL: $PayloadURL"
|
||||||
|
|
||||||
return $PayloadURL
|
return $PayloadURL
|
||||||
}
|
}
|
||||||
|
@ -432,12 +432,12 @@ function Prepend-Sdk-InstallRoot-To-Path([string]$InstallRoot, [string]$BinFolde
|
||||||
$CLIArchitecture = Get-CLIArchitecture-From-Architecture $Architecture
|
$CLIArchitecture = Get-CLIArchitecture-From-Architecture $Architecture
|
||||||
$SpecificVersion = Get-Specific-Version-From-Version -AzureFeed $AzureFeed -Channel $Channel -Version $Version
|
$SpecificVersion = Get-Specific-Version-From-Version -AzureFeed $AzureFeed -Channel $Channel -Version $Version
|
||||||
$DownloadLink = Get-Download-Link -AzureFeed $AzureFeed -Channel $Channel -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture
|
$DownloadLink = Get-Download-Link -AzureFeed $AzureFeed -Channel $Channel -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture
|
||||||
$AltDownloadLink = Get-AltDownload-Link -AzureFeed $AzureFeed -Channel $Channel -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture
|
$LegacyDownloadLink = Get-LegacyDownload-Link -AzureFeed $AzureFeed -Channel $Channel -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture
|
||||||
|
|
||||||
if ($DryRun) {
|
if ($DryRun) {
|
||||||
Say "Payload URLs:"
|
Say "Payload URLs:"
|
||||||
Say "Primary - $DownloadLink"
|
Say "Primary - $DownloadLink"
|
||||||
Say "Alternate - $AltDownloadLink"
|
Say "Legacy - $LegacyDownloadLink"
|
||||||
Say "Repeatable invocation: .\$($MyInvocation.MyCommand) -Version $SpecificVersion -Channel $Channel -Architecture $CLIArchitecture -InstallDir $InstallDir"
|
Say "Repeatable invocation: .\$($MyInvocation.MyCommand) -Version $SpecificVersion -Channel $Channel -Architecture $CLIArchitecture -InstallDir $InstallDir"
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
@ -469,7 +469,7 @@ try {
|
||||||
DownloadFile -Uri $DownloadLink -OutPath $ZipPath
|
DownloadFile -Uri $DownloadLink -OutPath $ZipPath
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
$DownloadLink = $AltDownloadLink
|
$DownloadLink = $LegacyDownloadLink
|
||||||
$ZipPath = [System.IO.Path]::GetTempFileName()
|
$ZipPath = [System.IO.Path]::GetTempFileName()
|
||||||
Say "Downloading $DownloadLink"
|
Say "Downloading $DownloadLink"
|
||||||
DownloadFile -Uri $DownloadLink -OutPath $ZipPath
|
DownloadFile -Uri $DownloadLink -OutPath $ZipPath
|
||||||
|
|
41
scripts/obtain/dotnet-install.sh
vendored
41
scripts/obtain/dotnet-install.sh
vendored
|
@ -147,7 +147,7 @@ get_distro_specific_os_name() {
|
||||||
fi
|
fi
|
||||||
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
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -412,7 +412,7 @@ construct_download_link() {
|
||||||
# channel - $2
|
# channel - $2
|
||||||
# normalized_architecture - $3
|
# normalized_architecture - $3
|
||||||
# specific_version - $4
|
# specific_version - $4
|
||||||
construct_alt_download_link() {
|
construct_legacy_download_link() {
|
||||||
eval $invocation
|
eval $invocation
|
||||||
|
|
||||||
local azure_feed=$1
|
local azure_feed=$1
|
||||||
|
@ -423,14 +423,14 @@ construct_alt_download_link() {
|
||||||
local distro_specific_osname
|
local distro_specific_osname
|
||||||
distro_specific_osname=$(get_distro_specific_os_name) || return 1
|
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
|
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
|
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
|
fi
|
||||||
|
|
||||||
echo "$alt_download_link"
|
echo "$legacy_download_link"
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -601,7 +601,8 @@ downloadwget() {
|
||||||
|
|
||||||
calculate_vars() {
|
calculate_vars() {
|
||||||
eval $invocation
|
eval $invocation
|
||||||
|
valid_legacy_download_link=true
|
||||||
|
|
||||||
normalized_architecture=$(get_normalized_architecture_from_architecture "$architecture")
|
normalized_architecture=$(get_normalized_architecture_from_architecture "$architecture")
|
||||||
say_verbose "normalized_architecture=$normalized_architecture"
|
say_verbose "normalized_architecture=$normalized_architecture"
|
||||||
|
|
||||||
|
@ -615,8 +616,13 @@ calculate_vars() {
|
||||||
download_link=$(construct_download_link $azure_feed $channel $normalized_architecture $specific_version)
|
download_link=$(construct_download_link $azure_feed $channel $normalized_architecture $specific_version)
|
||||||
say_verbose "download_link=$download_link"
|
say_verbose "download_link=$download_link"
|
||||||
|
|
||||||
alt_download_link=$(construct_alt_download_link $azure_feed $channel $normalized_architecture $specific_version)
|
legacy_download_link=$(construct_legacy_download_link $azure_feed $channel $normalized_architecture $specific_version) || valid_legacy_download_link=false
|
||||||
say_verbose "alt_download_link=$alt_download_link"
|
|
||||||
|
if [ "$valid_legacy_download_link" = true ]; then
|
||||||
|
say_verbose "legacy_download_link=$legacy_download_link"
|
||||||
|
else
|
||||||
|
say_verbose "Cound not construct a legacy_download_link; omitting..."
|
||||||
|
fi
|
||||||
|
|
||||||
install_root=$(resolve_installation_path $install_dir)
|
install_root=$(resolve_installation_path $install_dir)
|
||||||
say_verbose "install_root=$install_root"
|
say_verbose "install_root=$install_root"
|
||||||
|
@ -638,13 +644,13 @@ install_dotnet() {
|
||||||
say "Downloading link: $download_link"
|
say "Downloading link: $download_link"
|
||||||
download "$download_link" $zip_path || download_failed=true
|
download "$download_link" $zip_path || download_failed=true
|
||||||
|
|
||||||
# if the download fails, download the alt_download_link
|
# if the download fails, download the legacy_download_link
|
||||||
if [ "$download_failed" = true ]; then
|
if [ "$download_failed" = true ] && [ "$valid_legacy_download_link" = true ]; then
|
||||||
say "Cannot download: $download_link"
|
say "Cannot download: $download_link"
|
||||||
zip_path=$(mktemp $temporary_file_template)
|
zip_path=$(mktemp $temporary_file_template)
|
||||||
say_verbose "Alternate zip path: $zip_path"
|
say_verbose "Legacy zip path: $zip_path"
|
||||||
say "Downloading alternate link: $alt_download_link"
|
say "Downloading legacy link: $legacy_download_link"
|
||||||
download "$alt_download_link" $zip_path
|
download "$legacy_download_link" $zip_path
|
||||||
fi
|
fi
|
||||||
|
|
||||||
say "Extracting zip"
|
say "Extracting zip"
|
||||||
|
@ -657,7 +663,7 @@ local_version_file_relative_path="/.version"
|
||||||
bin_folder_relative_path=""
|
bin_folder_relative_path=""
|
||||||
temporary_file_template="${TMPDIR:-/tmp}/dotnet.XXXXXXXXX"
|
temporary_file_template="${TMPDIR:-/tmp}/dotnet.XXXXXXXXX"
|
||||||
|
|
||||||
channel="release/1.0.0"
|
channel="LTS"
|
||||||
version="Latest"
|
version="Latest"
|
||||||
install_dir="<auto>"
|
install_dir="<auto>"
|
||||||
architecture="<auto>"
|
architecture="<auto>"
|
||||||
|
@ -764,9 +770,12 @@ done
|
||||||
|
|
||||||
check_min_reqs
|
check_min_reqs
|
||||||
calculate_vars
|
calculate_vars
|
||||||
|
|
||||||
if [ "$dry_run" = true ]; then
|
if [ "$dry_run" = true ]; then
|
||||||
say "Payload URL: $download_link"
|
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"
|
say "Repeatable invocation: ./$(basename $0) --version $specific_version --channel $channel --install-dir $install_dir"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue