summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Jansa <martin.jansa@gmail.com>2013-03-01 18:42:22 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-03-02 13:00:53 +0000
commit3dba05d74821f08cd96a18351805c8812ddd626c (patch)
tree8e55f94880b2b67dd519bffe80ee1a3db5571a96
parenta66ed54490305380c549838f9a580528d5b49275 (diff)
downloadopenembedded-core-3dba05d74821f08cd96a18351805c8812ddd626c.tar.gz
openembedded-core-3dba05d74821f08cd96a18351805c8812ddd626c.tar.bz2
openembedded-core-3dba05d74821f08cd96a18351805c8812ddd626c.zip
sanity.bbclass: always use oe.lsb.distro_identifier method
* even when /etc/redhat-release or /etc/SuSE-release exists * don't read /etc/lsb-release manually, NATIVELSBSTRING is not reading it too Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/sanity.bbclass36
1 files changed, 4 insertions, 32 deletions
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index 94c6ce340f..06e95e3562 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -263,39 +263,11 @@ def check_supported_distro(sanity_data):
if not tested_distros:
return
- if os.path.exists("/etc/redhat-release"):
- f = open("/etc/redhat-release", "r")
- try:
- distro = f.readline().strip()
- finally:
- f.close()
- elif os.path.exists("/etc/SuSE-release"):
- import re
- f = open("/etc/SuSE-release", "r")
- try:
- distro = f.readline()
- # Remove the architecture suffix e.g. (i586)
- distro = re.sub(r' \([a-zA-Z0-9\-_]*\)$', '', distro).strip()
- finally:
- f.close()
- else:
- # Use LSB method
- try:
- distro = oe.lsb.distro_identifier()
- except Exception:
- distro = None
+ try:
+ distro = oe.lsb.distro_identifier()
+ except Exception:
+ distro = None
- if not distro:
- if os.path.exists("/etc/lsb-release"):
- f = open("/etc/lsb-release", "r")
- try:
- for line in f:
- lns = line.split('=')
- if lns[0] == "DISTRIB_DESCRIPTION":
- distro = lns[1].strip('"\n')
- break
- finally:
- f.close()
if distro:
if distro not in [x.strip() for x in tested_distros.split('\\n')]:
bb.warn('Host distribution "%s" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.' % distro)