meta/lib/oe/ fix data extraction from /etc/lsb-release

Submitted by Cristian Iorga on March 29, 2013, 9:19 a.m. | Patch ID: 47113


Message ID
State Accepted
Commit 5d0839bef631dceb4395fcf204779a76966a1061
Headers show

Commit Message

Cristian Iorga March 29, 2013, 9:19 a.m.
In some cases, /etc/lsb-release file is used to extract
info about poky build host machine. But the strings are
not stripped of end of line special characters. As such,
when this info is concatenated and used as a directory
entry in sstate_cache, this is an issue.
Usually, this issue is masked by the fact that distro
related info is extracted from the output of lsb_release
command. In case of Yocto Linux, running "lsb_release -a"
will give an error code because CODENAME info is not present.
As such, bitbake will extract the info from /etc/lsb-release,
running into the above issue.
Consequence is that building under BA will crash.

Partial fix for [YOCTO #4071]

Signed-off-by: Cristian Iorga <>
 meta/lib/oe/ |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/meta/lib/oe/ b/meta/lib/oe/
index f4a5ba1..ebf90ba 100644
--- a/meta/lib/oe/
+++ b/meta/lib/oe/
@@ -26,7 +26,7 @@  def release_dict_file():
             with open('/etc/lsb-release') as f:
                 for line in f:
                     key, value = line.split("=", 1)
-                    data[key] = value
+                    data[key] = value.strip()
         elif os.path.exists('/etc/redhat-release'):
             data = {}
             with open('/etc/redhat-release') as f: