diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 index 64a9d1c3f..c9257407f 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 @@ -6,9 +6,8 @@ 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 ", ") } @@ -16,7 +15,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 +27,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 7b1bd56ea..b59eae7f6 100644 --- a/images/linux/scripts/installers/gcc.sh +++ b/images/linux/scripts/installers/gcc.sh @@ -4,6 +4,10 @@ ## Desc: Installs GNU C++ ################################################################################ +set -e + +# Source the helpers for use with the script +source $HELPER_SCRIPTS/os.sh function InstallGcc { version=$1 @@ -29,7 +33,10 @@ versions=( "g++-9" ) -for version in ${versions[*]} -do +if ! isUbuntu16; then + versions+=("g++-10") +fi + +for version in ${versions[*]}; do InstallGcc $version done