[Ubuntu] Install the latest two versions of GHC (#2696)

* install two ghc versions

* fix comments
This commit is contained in:
Dibir Magomedsaygitov
2021-02-13 09:22:36 +03:00
committed by GitHub
parent 77b21e0c24
commit 06559cab21
2 changed files with 4 additions and 4 deletions

View File

@@ -13,9 +13,9 @@ apt-get install -y software-properties-common
add-apt-repository -y ppa:hvr/ghc add-apt-repository -y ppa:hvr/ghc
apt-get update apt-get update
# Get 3 latest Haskell Major.Minor versions # Get 2 latest Haskell Major.Minor versions
allGhcVersions=$(apt-cache search "^ghc-" | grep -Po '(\d*\.){2}\d*' | sort --unique --version-sort) allGhcVersions=$(apt-cache search "^ghc-" | grep -Po '(\d*\.){2}\d*' | sort --unique --version-sort)
ghcMajorMinorVersions=$(echo "$allGhcVersions" | cut -d "." -f 1,2 | sort --unique --version-sort | tail -3) ghcMajorMinorVersions=$(echo "$allGhcVersions" | cut -d "." -f 1,2 | sort --unique --version-sort | tail -2)
for version in $ghcMajorMinorVersions; do for version in $ghcMajorMinorVersions; do
# Get latest patch version for given Major.Minor one (ex. 8.6.5 for 8.6) and install it # Get latest patch version for given Major.Minor one (ex. 8.6.5 for 8.6) and install it

View File

@@ -5,9 +5,9 @@ Describe "Haskell" {
$testCase = @{ GHCVersions = $GHCVersions } $testCase = @{ GHCVersions = $GHCVersions }
It "GHC directory contains three version of GHC" -TestCases $testCase { It "GHC directory contains two version of GHC" -TestCases $testCase {
param ([object] $GHCVersions) param ([object] $GHCVersions)
$GHCVersions.Count | Should -Be 3 $GHCVersions.Count | Should -Be 2
} }
$testCases = $GHCVersions | ForEach-Object { @{ GHCPath = "${_}/bin/ghc"} } $testCases = $GHCVersions | ForEach-Object { @{ GHCPath = "${_}/bin/ghc"} }