Fix os_version detection for Ubuntu 16.04 (#2125)

This commit is contained in:
Teddy Reed 2016-05-28 20:02:58 -07:00
parent 37544138b5
commit 1cf80c9300

View File

@ -36,10 +36,16 @@ const std::string kLinuxOSRegex =
"\"";
#else
const std::string kLinuxOSRelease = "/etc/os-release";
#ifdef UBUNTU_XENIAL
const std::string kLinuxOSRegex =
"VERSION=\"(?P<major>[0-9]+)\\.(?P<minor>[0-9]+)[\\.]{0,1}(?P<patch>[0-9]+)"
"?.* \\((?P<name>[\\w ]*)\\)\"$";
#else
const std::string kLinuxOSRegex =
"VERSION=\"(?P<major>[0-9]+)\\.(?P<minor>[0-9]+)[\\.]{0,1}(?P<patch>[0-9]+)"
"?.*, (?P<name>[\\w ]*)\"$";
#endif
#endif
QueryData genOSVersion(QueryContext& context) {
std::string content;