meta/lib/oe/lsb.py: extract only the needed info from lsb-release

Instead of running lsb_release -a, a lsb_release -ir will be run.
This will prevent issue with distros that don't have all the needed
info in /etc/lsb-release file, in which case lsb_release won't generate
an error code.

Partial fix for [YOCTO #4071]

(From OE-Core rev: 79a2252545ab50c79e00e02c328191c1163f917d)

Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Cristian Iorga 2013-03-29 16:10:51 +02:00 committed by Richard Purdie
parent 851f1e368b
commit e9866ee0ff

View File

@ -1,9 +1,9 @@
def release_dict():
"""Return the output of lsb_release -a as a dictionary"""
"""Return the output of lsb_release -ir as a dictionary"""
from subprocess import PIPE
try:
output, err = bb.process.run(['lsb_release', '-a'], stderr=PIPE)
output, err = bb.process.run(['lsb_release', '-ir'], stderr=PIPE)
except bb.process.CmdError as exc:
return None