summaryrefslogtreecommitdiffstats
path: root/mkspecs
diff options
context:
space:
mode:
authorCaroline Chao <caroline.chao@theqtcompany.com>2015-04-15 13:26:55 +0200
committerCaroline Chao <caroline.chao@theqtcompany.com>2015-05-13 11:21:19 +0000
commit6c20a01cb9032a6abc0b82549a4242e2441894f7 (patch)
treebc68427244429477508dc4ddd84fb7f70ecc1754 /mkspecs
parent78a10908211ed604c0f7c7b6bbc6dcace4f01bd0 (diff)
QSysInfo: Expand Linux distribution detection
Expand Linux distribution detection to /etc/redhat-release and /etc/debian_version to follow what /usr/bin/lsb_release script does. If /usr/bin/lsb_release fails to extract the distribution information from /etc/lsb-release, it then checks /etc/redhat-release and, as a last fallback, /etc/debian_version. Some Red Hat distributions have a /etc/lsb-release file that does not provide the values we are looking for (DISTRIB_ID, DISTRIB_RELEASE and DISTRIB_DESCRIPTION). If both productType or productVersion are empty after reading /etc/lsb-release, readEtcLsbRelease() will return false, allowing further parsing of /etc/redhat-release. This scenario mimics what the /usr/bin/lsb_release script does if /etc/lsb-release does not contains enough information. The productType and productVersion returned by QSysInfo after reading /etc/redhat-release match the distributor id and release information returned by the /usr/bin/lsb_release script. For Debian Linux distributions where /etc/os-release, /etc/lsb-release and /etc/redhat-release are not available nor usable, the /usr/bin/lsb_release script also checks for the /etc/debian_version file. In this case, we also enable parsing of /etc/debian_version to retrieve a fallback productVersion, the productType being set to Debian. Change-Id: Ia20d513d78be8a8ee8c0410d0aaa052fde81a41d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'mkspecs')
0 files changed, 0 insertions, 0 deletions