From 8351c8923a4e2ca76f16642c1642a0b85eaec5b3 Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Sun, 2 Apr 2023 00:30:36 +0100 Subject: [PATCH] Make version info work without lsb-release installed --- common/build_version.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/common/build_version.cpp b/common/build_version.cpp index 09be594f28..ce6d68e1ca 100644 --- a/common/build_version.cpp +++ b/common/build_version.cpp @@ -175,12 +175,20 @@ wxString GetVersionInfoData( const wxString& aTitle, bool aHtml, bool aBrief ) aMsg << eol; - aMsg << "Platform: " + wxString osDescription; + #if __LINUX__ - << wxGetLinuxDistributionInfo().Description << ", " -#else - << wxGetOsDescription() << ", " + osDescription = wxGetLinuxDistributionInfo().Description; #endif + + // Linux uses the lsb-release program to get the description of the OS, if lsb-release + // isn't installed, then the string will be empty and we fallback to the method used on + // the other platforms (to at least get the kernel/uname info). + if( osDescription.empty() ) + osDescription = wxGetOsDescription(); + + aMsg << "Platform: " + << osDescription << ", " << GetPlatformGetBitnessName() << ", " << platform.GetEndiannessName() << ", " << platform.GetPortIdName();