| 128 | } |
| 129 | |
| 130 | void Sys::lsb_postprocess(Sys::LsbInfo& lsb, Sys::DistributionInfo& out) |
| 131 | { |
| 132 | QString dist = lsb.distributor; |
| 133 | QString vers = lsb.version; |
| 134 | if (dist.startsWith("redhatenterprise")) { |
| 135 | dist = "rhel"; |
| 136 | } else if (dist == "archlinux") { |
| 137 | dist = "arch"; |
| 138 | } else if (dist.startsWith("suse")) { |
| 139 | if (lsb.description.startsWith("opensuse")) { |
| 140 | dist = "opensuse"; |
| 141 | } else if (lsb.description.startsWith("suse linux enterprise")) { |
| 142 | dist = "sles"; |
| 143 | } |
| 144 | } else if (dist == "debian" and vers == "testing") { |
| 145 | vers = lsb.codename; |
| 146 | } else { |
| 147 | // ubuntu, debian, gentoo, scientific, slackware, ... ? |
| 148 | #if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) |
| 149 | auto parts = dist.split(QRegularExpression("\\s+"), Qt::SkipEmptyParts); |
| 150 | #else |
| 151 | auto parts = dist.split(QRegularExpression("\\s+"), QString::SkipEmptyParts); |
| 152 | #endif |
| 153 | if (parts.size()) { |
| 154 | dist = parts[0]; |
| 155 | } |
| 156 | } |
| 157 | if (!dist.isEmpty()) { |
| 158 | out.distributionName = dist; |
| 159 | out.distributionVersion = vers; |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | Sys::DistributionInfo Sys::read_lsb_release() |
| 164 | { |