diff options
author | Petr Mrázek <peterix@gmail.com> | 2018-03-11 23:00:54 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2018-03-13 00:28:51 +0100 |
commit | 82208be49eecc07f9c6a38365876c28273529192 (patch) | |
tree | f900b2acfc8f205208be4cc97abe3e3f4b109c20 /libraries/systeminfo/src/sys_unix.cpp | |
parent | b497aee9201541459cef41a68f572f9aed2d1dbb (diff) | |
download | MultiMC-82208be49eecc07f9c6a38365876c28273529192.tar MultiMC-82208be49eecc07f9c6a38365876c28273529192.tar.gz MultiMC-82208be49eecc07f9c6a38365876c28273529192.tar.lz MultiMC-82208be49eecc07f9c6a38365876c28273529192.tar.xz MultiMC-82208be49eecc07f9c6a38365876c28273529192.zip |
NOISSUE add linux distro name and release stats to analytics
Hopefully this can serve as some sort of guideline for focusing
effort towards the right distro packages to make.
Diffstat (limited to 'libraries/systeminfo/src/sys_unix.cpp')
-rw-r--r-- | libraries/systeminfo/src/sys_unix.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/libraries/systeminfo/src/sys_unix.cpp b/libraries/systeminfo/src/sys_unix.cpp index 866c9fdb..313908f3 100644 --- a/libraries/systeminfo/src/sys_unix.cpp +++ b/libraries/systeminfo/src/sys_unix.cpp @@ -1,5 +1,7 @@ #include "sys.h" +#include "distroutils.h" + #include <sys/utsname.h> #include <fstream> @@ -47,3 +49,27 @@ bool Sys::isSystem64bit() // kernel build arch on linux return QSysInfo::currentCpuArchitecture() == "x86_64"; } + +Sys::DistributionInfo Sys::getDistributionInfo() +{ + DistributionInfo systemd_info = read_os_release(); + DistributionInfo lsb_info = read_lsb_release(); + DistributionInfo legacy_info = read_legacy_release(); + DistributionInfo result = systemd_info + lsb_info + legacy_info; + if(result.distributionName.isNull()) + { + result.distributionName = "unknown"; + } + if(result.distributionVersion.isNull()) + { + if(result.distributionName == "arch") + { + result.distributionVersion = "rolling"; + } + else + { + result.distributionVersion = "unknown"; + } + } + return result; +} |