Update dependencies from https://github.com/dotnet/arcade build 20201026.10 (#8983)

[master] Update dependencies from dotnet/arcade
This commit is contained in:
dotnet-maestro[bot] 2020-10-28 15:07:45 +00:00 committed by GitHub
parent 7aba0fe311
commit f45b44b66f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 46 additions and 1986 deletions

View file

@ -57,15 +57,11 @@ set-strictmode -version 2.0
$ErrorActionPreference = 'Stop'
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
# If specified, provides an alternate path for getting .NET Core SDKs and Runtimes. This script will still try public sources first.
# If specifies, provides an alternate path for getting .NET Core SDKs and Runtimes. This script will still try public sources first.
[string]$runtimeSourceFeed = if (Test-Path variable:runtimeSourceFeed) { $runtimeSourceFeed } else { $null }
# Base-64 encoded SAS token that has permission to storage container described by $runtimeSourceFeed
[string]$runtimeSourceFeedKey = if (Test-Path variable:runtimeSourceFeedKey) { $runtimeSourceFeedKey } else { $null }
# If false, use copy of dotnet-install from /eng/common/dotnet-install-scripts (for custom behaviors).
# otherwise will fetch from public location.
[bool]$useDefaultDotnetInstall = if (Test-Path variable:useDefaultDotnetInstall) { $useDefaultDotnetInstall } else { $false }
function Create-Directory ([string[]] $path) {
New-Item -Path $path -Force -ItemType 'Directory' | Out-Null
}
@ -197,46 +193,37 @@ function InitializeDotNetCli([bool]$install, [bool]$createSdkLocationFile) {
function GetDotNetInstallScript([string] $dotnetRoot) {
$installScript = Join-Path $dotnetRoot 'dotnet-install.ps1'
if (!(Test-Path $installScript)) {
create-directory $dotnetroot
Create-Directory $dotnetRoot
$ProgressPreference = 'SilentlyContinue' # Don't display the console progress UI - it's a huge perf hit
if ($useDefaultDotnetInstall)
{
$progresspreference = 'silentlycontinue' # don't display the console progress ui - it's a huge perf hit
$maxRetries = 5
$retries = 1
$maxretries = 5
$retries = 1
$uri = "https://dot.net/$dotnetInstallScriptVersion/dotnet-install.ps1"
$uri = "https://dot.net/$dotnetinstallscriptversion/dotnet-install.ps1"
while($true) {
try {
write-host "get $uri"
invoke-webrequest $uri -outfile $installscript
break
}
catch {
write-host "failed to download '$uri'"
write-error $_.exception.message -erroraction continue
}
if (++$retries -le $maxretries) {
$delayinseconds = [math]::pow(2, $retries) - 1 # exponential backoff
write-host "retrying. waiting for $delayinseconds seconds before next attempt ($retries of $maxretries)."
start-sleep -seconds $delayinseconds
}
else {
throw "unable to download file in $maxretries attempts."
}
while($true) {
try {
Write-Host "GET $uri"
Invoke-WebRequest $uri -OutFile $installScript
break
}
}
else
{
# Use a special version of the script from eng/common that understands the existence of a "productVersion.txt" in a dotnet path.
# See https://github.com/dotnet/arcade/issues/6047 for details
$engCommonCopy = Resolve-Path (Join-Path $PSScriptRoot 'dotnet-install-scripts\dotnet-install.ps1')
Copy-Item $engCommonCopy -Destination $installScript -Force
catch {
Write-Host "Failed to download '$uri'"
Write-Error $_.Exception.Message -ErrorAction Continue
}
if (++$retries -le $maxRetries) {
$delayInSeconds = [math]::Pow(2, $retries) - 1 # Exponential backoff
Write-Host "Retrying. Waiting for $delayInSeconds seconds before next attempt ($retries of $maxRetries)."
Start-Sleep -Seconds $delayInSeconds
}
else {
throw "Unable to download file in $maxRetries attempts."
}
}
}
return $installScript
}