Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 21 additions & 12 deletions build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -1801,6 +1801,7 @@ function Install-Dotnet {
[string]$Channel = $dotnetCLIChannel,
[string]$Version = $dotnetCLIRequiredVersion,
[string]$Quality = $dotnetCLIQuality,
[switch]$RemovePreviousVersion,
[switch]$NoSudo,
[string]$InstallDir,
[string]$AzureFeed,
Expand All @@ -1821,20 +1822,22 @@ function Install-Dotnet {
if ($environment.IsLinux -or $environment.IsMacOS) {
$wget = Get-Command -Name wget -CommandType Application -TotalCount 1 -ErrorAction Stop

# Uninstall all previous dotnet packages
$uninstallScript = if ($environment.IsLinux -and $environment.IsUbuntu) {
"dotnet-uninstall-debian-packages.sh"
} elseif ($environment.IsMacOS) {
"dotnet-uninstall-pkgs.sh"
}
# Attempt to uninstall previous dotnet packages if requested
if ($RemovePreviousVersion) {
Comment thread
PaulHigin marked this conversation as resolved.
$uninstallScript = if ($environment.IsLinux -and $environment.IsUbuntu) {
"dotnet-uninstall-debian-packages.sh"
} elseif ($environment.IsMacOS) {
"dotnet-uninstall-pkgs.sh"
}

if ($uninstallScript) {
Start-NativeExecution {
& $wget $uninstallObtainUrl/uninstall/$uninstallScript
Invoke-Expression "$sudo bash ./$uninstallScript"
if ($uninstallScript) {
Start-NativeExecution {
& $wget $uninstallObtainUrl/uninstall/$uninstallScript
Invoke-Expression "$sudo bash ./$uninstallScript"
}
} else {
Write-Warning "This script only removes prior versions of dotnet for Ubuntu and OS X"
}
} else {
Write-Warning "This script only removes prior versions of dotnet for Ubuntu and OS X"
}

Write-Verbose -Verbose "Invoking install script"
Expand Down Expand Up @@ -1868,6 +1871,8 @@ function Install-Dotnet {
$bashArgs += @('-FeedCredential', $FeedCredential)
}

$bashArgs += @('-skipnonversionedfiles')

$bashArgs | Out-String | Write-Verbose -Verbose

Start-NativeExecution {
Expand Down Expand Up @@ -1898,6 +1903,8 @@ function Install-Dotnet {
$installArgs += @{FeedCredential = $FeedCredential}
}

$installArgs += @{ SkipNonVersionedFiles = $true }

$installArgs | Out-String | Write-Verbose -Verbose

& ./$installScript @installArgs
Expand Down Expand Up @@ -1926,6 +1933,8 @@ function Install-Dotnet {
$psArgs += @('-FeedCredential', $FeedCredential)
}

$psArgs += @('-SkipNonVersionedFiles')

$psArgs | Out-String | Write-Verbose -Verbose

Start-NativeExecution {
Expand Down
6 changes: 3 additions & 3 deletions tools/cgmanifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
"Type": "nuget",
"Nuget": {
"Name": "Microsoft.Win32.SystemEvents",
"Version": "6.0.0"
"Version": "6.0.1"
}
},
"DevelopmentDependency": false
Expand Down Expand Up @@ -825,7 +825,7 @@
"Type": "nuget",
"Nuget": {
"Name": "System.Diagnostics.PerformanceCounter",
"Version": "6.0.0"
"Version": "6.0.1"
}
},
"DevelopmentDependency": false
Expand Down Expand Up @@ -975,7 +975,7 @@
"Type": "nuget",
"Nuget": {
"Name": "System.Net.Http.WinHttpHandler",
"Version": "6.0.0"
"Version": "6.0.1"
}
},
"DevelopmentDependency": false
Expand Down