summaryrefslogtreecommitdiffstats
path: root/meta/classes/sanity.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/sanity.bbclass')
-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):
263 if not tested_distros: 263 if not tested_distros:
264 return 264 return
265 265
266 if os.path.exists("/etc/redhat-release"): 266 try:
267 f = open("/etc/redhat-release", "r") 267 distro = oe.lsb.distro_identifier()
268 try: 268 except Exception:
269 distro = f.readline().strip() 269 distro = None
270 finally:
271 f.close()
272 elif os.path.exists("/etc/SuSE-release"):
273 import re
274 f = open("/etc/SuSE-release", "r")
275 try:
276 distro = f.readline()
277 # Remove the architecture suffix e.g. (i586)
278 distro = re.sub(r' \([a-zA-Z0-9\-_]*\)$', '', distro).strip()
279 finally:
280 f.close()
281 else:
282 # Use LSB method
283 try:
284 distro = oe.lsb.distro_identifier()
285 except Exception:
286 distro = None
287 270
288 if not distro:
289 if os.path.exists("/etc/lsb-release"):
290 f = open("/etc/lsb-release", "r")
291 try:
292 for line in f:
293 lns = line.split('=')
294 if lns[0] == "DISTRIB_DESCRIPTION":
295 distro = lns[1].strip('"\n')
296 break
297 finally:
298 f.close()
299 if distro: 271 if distro:
300 if distro not in [x.strip() for x in tested_distros.split('\\n')]: 272 if distro not in [x.strip() for x in tested_distros.split('\\n')]:
301 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) 273 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)