Update dotnet-install.ps1 to stop overwriting dotnet.exe

Also, update to NuGet.exe 4.0.0-rc4
This commit is contained in:
Nate McMaster 2017-02-09 15:19:20 -08:00
Родитель 74d196033d
Коммит 4714308000
3 изменённых файлов: 16 добавлений и 16 удалений

Просмотреть файл

@ -98,7 +98,7 @@ if (!(Test-Path "$koreBuildFolder\Sake"))
}
# We still nuget because dotnet doesn't have support for pushing packages
Invoke-WebRequest "https://dist.nuget.org/win-x86-commandline/v3.5.0-beta2/NuGet.exe" -OutFile "$koreBuildFolder/nuget.exe"
Invoke-WebRequest "https://dist.nuget.org/win-x86-commandline/v4.0.0-rc4/NuGet.exe" -OutFile "$koreBuildFolder/nuget.exe"
}
$makeFilePath = "makefile.shade"

Просмотреть файл

@ -108,7 +108,7 @@ export DOTNET_REFERENCE_ASSEMBLIES_PATH=$netFrameworkContentDir
nugetPath="$koreBuildFolder/nuget.exe"
if [ ! -f $nugetPath ]; then
nugetUrl="https://dist.nuget.org/win-x86-commandline/v3.5.0-beta2/NuGet.exe"
nugetUrl="https://dist.nuget.org/win-x86-commandline/v4.0.0-rc4/NuGet.exe"
wget -O $nugetPath $nugetUrl 2>/dev/null || curl -o $nugetPath --location $nugetUrl 2>/dev/null
fi

28
build/dotnet/dotnet-install.ps1 поставляемый
Просмотреть файл

@ -69,7 +69,7 @@ $BinFolderRelativePath=""
# example path with regex: shared/1.0.0-beta-12345/somepath
$VersionRegEx="/\d+\.\d+[^/]+/"
$OverrideNonVersionedFiles=$true
$OverrideNonVersionedFiles=$false
function Say($str) {
Write-Host "dotnet-install: $str"
@ -125,7 +125,7 @@ function Get-Latest-Version-Info([string]$AzureFeed, [string]$AzureChannel, [str
else {
$VersionFileUrl = "$AzureFeed/$AzureChannel/dnvm/latest.win.$CLIArchitecture.version"
}
$Response = Invoke-WebRequest -UseBasicParsing $VersionFileUrl
switch ($Response.Headers.'Content-Type'){
@ -133,7 +133,7 @@ function Get-Latest-Version-Info([string]$AzureFeed, [string]$AzureChannel, [str
{ ($_ -eq "text/plain") } { $VersionText = $Response.Content }
default { throw "``$Response.Headers.'Content-Type'`` is an unknown .version file content type." }
}
$VersionInfo = Get-Version-Info-From-Version-Text $VersionText
@ -169,7 +169,7 @@ function Get-Specific-Version-From-Version([string]$AzureFeed, [string]$AzureCha
function Get-Download-Links([string]$AzureFeed, [string]$AzureChannel, [string]$SpecificVersion, [string]$CLIArchitecture) {
Say-Invocation $MyInvocation
$ret = @()
$files = @()
if ($SharedRuntime) {
@ -178,7 +178,7 @@ function Get-Download-Links([string]$AzureFeed, [string]$AzureChannel, [string]$
else {
$files += "dotnet-dev";
}
foreach ($file in $files) {
$PayloadURL = "$AzureFeed/$AzureChannel/Binaries/$SpecificVersion/$file-win-$CLIArchitecture.$SpecificVersion.zip"
Say-Verbose "Constructed payload URL: $PayloadURL"
@ -212,7 +212,7 @@ function Get-Version-Info-From-Version-File([string]$InstallRoot, [string]$Relat
$VersionFile = Join-Path -Path $InstallRoot -ChildPath $RelativePathToVersionFile
Say-Verbose "Local version file: $VersionFile"
if (Test-Path $VersionFile) {
$VersionText = cat $VersionFile
Say-Verbose "Local version file text: $VersionText"
@ -226,7 +226,7 @@ function Get-Version-Info-From-Version-File([string]$InstallRoot, [string]$Relat
function Is-Dotnet-Package-Installed([string]$InstallRoot, [string]$RelativePathToPackage, [string]$SpecificVersion) {
Say-Invocation $MyInvocation
$DotnetPackagePath = Join-Path -Path $InstallRoot -ChildPath $RelativePathToPackage | Join-Path -ChildPath $SpecificVersion
Say-Verbose "Is-Dotnet-Package-Installed: Path to a package: $DotnetPackagePath"
return Test-Path $DotnetPackagePath -PathType Container
@ -244,13 +244,13 @@ function Get-Path-Prefix-With-Version($path) {
if ($match.Success) {
return $entry.FullName.Substring(0, $match.Index + $match.Length)
}
return $null
}
function Get-List-Of-Directories-And-Versions-To-Unpack-From-Dotnet-Package([System.IO.Compression.ZipArchive]$Zip, [string]$OutPath) {
Say-Invocation $MyInvocation
$ret = @()
foreach ($entry in $Zip.Entries) {
$dir = Get-Path-Prefix-With-Version $entry.FullName
@ -261,12 +261,12 @@ function Get-List-Of-Directories-And-Versions-To-Unpack-From-Dotnet-Package([Sys
}
}
}
$ret = $ret | Sort-Object | Get-Unique
$values = ($ret | foreach { "$_" }) -join ";"
Say-Verbose "Directories to unpack: $values"
return $ret
}
@ -290,9 +290,9 @@ function Extract-Dotnet-Package([string]$ZipPath, [string]$OutPath) {
Set-Variable -Name Zip
try {
$Zip = [System.IO.Compression.ZipFile]::OpenRead($ZipPath)
$DirectoriesToUnpack = Get-List-Of-Directories-And-Versions-To-Unpack-From-Dotnet-Package -Zip $Zip -OutPath $OutPath
foreach ($entry in $Zip.Entries) {
$PathWithVersion = Get-Path-Prefix-With-Version $entry.FullName
if (($PathWithVersion -eq $null) -Or ($DirectoriesToUnpack -contains $PathWithVersion)) {