From 06559cab210e57830e14de85a6c88d5517562ba1 Mon Sep 17 00:00:00 2001 From: Dibir Magomedsaygitov <61747324+dibir-magomedsaygitov@users.noreply.github.com> Date: Sat, 13 Feb 2021 09:22:36 +0300 Subject: [PATCH] [Ubuntu] Install the latest two versions of GHC (#2696) * install two ghc versions * fix comments --- images/linux/scripts/installers/haskell.sh | 4 ++-- images/linux/scripts/tests/Haskell.Tests.ps1 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/images/linux/scripts/installers/haskell.sh b/images/linux/scripts/installers/haskell.sh index 4bb123571..206bfe567 100644 --- a/images/linux/scripts/installers/haskell.sh +++ b/images/linux/scripts/installers/haskell.sh @@ -13,9 +13,9 @@ apt-get install -y software-properties-common add-apt-repository -y ppa:hvr/ghc 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) -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 # Get latest patch version for given Major.Minor one (ex. 8.6.5 for 8.6) and install it diff --git a/images/linux/scripts/tests/Haskell.Tests.ps1 b/images/linux/scripts/tests/Haskell.Tests.ps1 index 7a6133d06..45cc2be3e 100644 --- a/images/linux/scripts/tests/Haskell.Tests.ps1 +++ b/images/linux/scripts/tests/Haskell.Tests.ps1 @@ -5,9 +5,9 @@ Describe "Haskell" { $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) - $GHCVersions.Count | Should -Be 3 + $GHCVersions.Count | Should -Be 2 } $testCases = $GHCVersions | ForEach-Object { @{ GHCPath = "${_}/bin/ghc"} }