| 120 | } |
| 121 | |
| 122 | bool Sys::fallback_lsb_info(Sys::LsbInfo & out) |
| 123 | { |
| 124 | // running lsb_release failed, try to read the file instead |
| 125 | // /etc/lsb-release format, if the file even exists, is non-standard. |
| 126 | // Only the `lsb_release` command is specified by LSB. Nonetheless, some |
| 127 | // distributions install an /etc/lsb-release as part of the base |
| 128 | // distribution, but `lsb_release` remains optional. |
| 129 | QString file = "/etc/lsb-release"; |
| 130 | if (QFile::exists(file)) |
| 131 | { |
| 132 | QSettings settings(file, QSettings::IniFormat); |
| 133 | if(settings.contains("DISTRIB_ID")) |
| 134 | { |
| 135 | out.distributor = settings.value("DISTRIB_ID").toString().toLower(); |
| 136 | } |
| 137 | if(settings.contains("DISTRIB_RELEASE")) |
| 138 | { |
| 139 | out.version = settings.value("DISTRIB_RELEASE").toString().toLower(); |
| 140 | } |
| 141 | return !out.distributor.isEmpty(); |
| 142 | } |
| 143 | return false; |
| 144 | } |
| 145 | |
| 146 | void Sys::lsb_postprocess(Sys::LsbInfo & lsb, Sys::DistributionInfo & out) |
| 147 | { |