From c63f698e70e379dd63a60d95f20f7d278882af61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Juli=C3=A1n=20Merelo=20Guerv=C3=B3s?= Date: Wed, 20 Jan 2021 09:27:55 +0100 Subject: [PATCH] [ubuntu] Adds detection of cpan version (#2488) * Adds detection of cpan version The Perl package manager * Adds detected cpan version * Updates copypasta --- .../scripts/SoftwareReport/SoftwareReport.Common.psm1 | 7 +++++++ .../scripts/SoftwareReport/SoftwareReport.Generator.ps1 | 1 + 2 files changed, 8 insertions(+) diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 index ab680f739..90c98dcf4 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 @@ -91,6 +91,13 @@ function Get-HomebrewVersion { return "Homebrew $version" } +function Get-CpanVersion { + $result = Get-CommandResult "cpan --version" + $result.Output -match "version (?\d+\.\d+) " | Out-Null + $cpanVersion = $Matches.version + return "cpan $cpanVersion" +} + function Get-GemVersion { $result = Get-CommandResult "gem --version" $result.Output -match "(?\d+\.\d+\.\d+)" | Out-Null diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 index 406649526..5259a88f7 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 @@ -53,6 +53,7 @@ $markdown += New-MDHeader "Package Management" -Level 3 $packageManagementList = @( (Get-HomebrewVersion), + (Get-CpanVersion), (Get-GemVersion), (Get-MinicondaVersion), (Get-HelmVersion),