From 207f49ed9343b65a01c0750a2e552d05a3bd985b Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Thu, 24 Sep 2020 13:01:25 +0300 Subject: [PATCH 1/3] add g++-10 --- .../linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 | 6 +++--- images/linux/scripts/installers/gcc.sh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 index 64a9d1c3..267dcac3 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 @@ -8,7 +8,7 @@ function Get-CPPVersions { $cppVersions = apt list --installed 2>&1 | Where-Object { $_ -match "g\+\+-\d+"} | ForEach-Object { $_ -match "now (?\d+\.\d+\.\d+)-" | Out-Null $Matches.version - } + } | Sort-Object {[Version]$_} return "GNU C++ " + ($cppVersions -Join ", ") } @@ -16,7 +16,7 @@ function Get-FortranVersions { $fortranVersions = apt list --installed 2>&1 | Where-Object { $_ -match "^gfortran-\d+"} | ForEach-Object { $_ -match "now (?\d+\.\d+\.\d+)-" | Out-Null $Matches.version - } + } | Sort-Object {[Version]$_} return "GNU Fortran " + ($fortranVersions -Join ", ") } @@ -28,7 +28,7 @@ function Get-ClangVersions { $_ -match "clang version (?\d+\.\d+\.\d+)-" | Out-Null $Matches.version } - } + } | Sort-Object {[Version]$_} return "Clang " + ($clangVersions -Join ", ") } diff --git a/images/linux/scripts/installers/gcc.sh b/images/linux/scripts/installers/gcc.sh index 7b1bd56e..914c3e1e 100644 --- a/images/linux/scripts/installers/gcc.sh +++ b/images/linux/scripts/installers/gcc.sh @@ -4,7 +4,6 @@ ## Desc: Installs GNU C++ ################################################################################ - function InstallGcc { version=$1 @@ -27,6 +26,7 @@ versions=( "g++-7" "g++-8" "g++-9" + "g++-10" ) for version in ${versions[*]} From 72bd7db479417c7aca8386daa2a7c86f5a945871 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Thu, 24 Sep 2020 20:49:22 +0300 Subject: [PATCH 2/3] exclude Ubuntu16 --- images/linux/scripts/installers/gcc.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/images/linux/scripts/installers/gcc.sh b/images/linux/scripts/installers/gcc.sh index 914c3e1e..b59eae7f 100644 --- a/images/linux/scripts/installers/gcc.sh +++ b/images/linux/scripts/installers/gcc.sh @@ -4,6 +4,11 @@ ## Desc: Installs GNU C++ ################################################################################ +set -e + +# Source the helpers for use with the script +source $HELPER_SCRIPTS/os.sh + function InstallGcc { version=$1 @@ -26,10 +31,12 @@ versions=( "g++-7" "g++-8" "g++-9" - "g++-10" ) -for version in ${versions[*]} -do +if ! isUbuntu16; then + versions+=("g++-10") +fi + +for version in ${versions[*]}; do InstallGcc $version done From 1f73bc3e70a6591e632ba3466e2e2138e92f85b4 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Fri, 25 Sep 2020 12:41:45 +0300 Subject: [PATCH 3/3] fix markdown output --- images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 index 267dcac3..c9257407 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 @@ -6,8 +6,7 @@ function Get-OSName { function Get-CPPVersions { $cppVersions = apt list --installed 2>&1 | Where-Object { $_ -match "g\+\+-\d+"} | ForEach-Object { - $_ -match "now (?\d+\.\d+\.\d+)-" | Out-Null - $Matches.version + & $_.Split("/")[0] --version | Select-Object -First 1 | Take-OutputPart -Part 3 } | Sort-Object {[Version]$_} return "GNU C++ " + ($cppVersions -Join ", ") }