From 62e9da75e7b3877ec48704e7342dad56d51330c8 Mon Sep 17 00:00:00 2001 From: Vasilii Polikarpov <126792224+vpolikarpov-akvelon@users.noreply.github.com> Date: Thu, 28 Sep 2023 09:56:05 +0200 Subject: [PATCH] [Windows] Fix mingw related lines in software report (#8389) --- .../SoftwareReport/SoftwareReport.Generator.ps1 | 4 +++- .../SoftwareReport/SoftwareReport.Tools.psm1 | 16 ++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 index 558542718..dcd76b889 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 @@ -86,7 +86,9 @@ $tools.AddToolVersion("jq", $(Get-JQVersion)) $tools.AddToolVersion("Kind", $(Get-KindVersion)) $tools.AddToolVersion("Kubectl", $(Get-KubectlVersion)) $tools.AddToolVersion("Mercurial", $(Get-MercurialVersion)) -$tools.AddToolVersion("Mingw-w64", $(Get-MinGWVersion)) +$tools.AddToolVersion("gcc", $(Get-GCCVersion)) +$tools.AddToolVersion("gdb", $(Get-GDBVersion)) +$tools.AddToolVersion("GNU Binutils", $(Get-GNUBinutilsVersion)) $tools.AddToolVersion("Newman", $(Get-NewmanVersion)) $tools.AddToolVersion("NSIS", $(Get-NSISVersion)) $tools.AddToolVersion("OpenSSL", $(Get-OpenSSLVersion)) diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 b/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 index 86a645f8f..b1038167e 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 @@ -107,8 +107,20 @@ function Get-KindVersion { return $kindVersion } -function Get-MinGWVersion { - (gcc --version | Select-String -Pattern "MinGW-W64") -match "(?\d+\.\d+\.\d+)" | Out-Null +function Get-GCCVersion { + (gcc --version | Select-String -Pattern "gcc.exe") -match "(?\d+\.\d+\.\d+)" | Out-Null + $mingwVersion = $Matches.Version + return $mingwVersion +} + +function Get-GDBVersion { + (gdb --version | Select-String -Pattern "GNU gdb") -match "(?\d+\.\d+)" | Out-Null + $mingwVersion = $Matches.Version + return $mingwVersion +} + +function Get-GNUBinutilsVersion { + (ld --version | Select-String -Pattern "GNU Binutils") -match "(?\d+\.\d+)" | Out-Null $mingwVersion = $Matches.Version return $mingwVersion }