Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework Mono installation to avoid using apt repos on Ubuntu images #3289

Merged
merged 2 commits into from
May 21, 2021
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
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ function Get-ErlangVersion {

function Get-MonoVersion {
$monoVersion = mono --version | Out-String | Take-OutputPart -Part 4
return "Mono $monoVersion"
$aptSourceRepo = Get-AptSourceRepository -PackageName "mono"
return "Mono $monoVersion (apt source repository: $aptSourceRepo)"
}

function Get-MsbuildVersion {
Expand Down
2 changes: 1 addition & 1 deletion images/linux/scripts/helpers/SoftwareReport.Helpers.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function Get-CachedToolInstances
function Get-AptSourceRepository {
param([String] $PackageName)

$sourceUrl = Get-Content "$PSScriptRoot/../helpers/apt-sources.txt" | Select-String -Pattern $PackageName | Take-OutputPart -Part 1
$sourceUrl = Get-Content "$PSScriptRoot/../helpers/apt-sources.txt" | Select-String -Pattern $PackageName | Take-OutputPart -Part (1..3)
return $sourceUrl
}

4 changes: 4 additions & 0 deletions images/linux/scripts/installers/mono.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@ echo "deb https://download.mono-project.com/repo/ubuntu stable-$LSB_CODENAME mai
apt-get update
apt-get install -y --no-install-recommends apt-transport-https mono-complete nuget

rm /etc/apt/sources.list.d/mono-official-stable.list
rm -f /etc/apt/sources.list.d/mono-official-stable.list.save
echo "mono https://download.mono-project.com/repo/ubuntu stable-$LSB_CODENAME main" >> $HELPER_SCRIPTS/apt-sources.txt

invoke_tests "Tools" "Mono"