[bitbake-devel] [PATCH 2/3] lib/bb/command.py: ensure setVariable only sets values as strings

Paul Eggleton paul.eggleton at linux.intel.com
Tue Sep 11 16:52:00 UTC 2012


This is the interface Hob uses to set variable values in many instances,
and at the moment it is possible that some of the values it passes are
not strings. If a non-string value gets into the datastore it can
trigger exceptions during parsing when we attempt to expand the variable
and substitute in the non-string value.

This fixes using the meta-ti layer within Hob - it currently has a
reference to BB_NUMBER_THREADS within a shell function and since this
is a variable that Hob was setting from its configuration as an integer,
due to the above this was triggering an ExpansionError.

Fixes [YOCTO #2875].

Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
---
 bitbake/lib/bb/command.py |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py
index fd8912a..27b5171 100644
--- a/bitbake/lib/bb/command.py
+++ b/bitbake/lib/bb/command.py
@@ -157,7 +157,7 @@ class CommandsSync:
         Set the value of variable in configuration.data
         """
         varname = params[0]
-        value = params[1]
+        value = str(params[1])
         command.cooker.configuration.data.setVar(varname, value)
 
     def initCooker(self, command, params):
-- 
1.7.9.5





More information about the bitbake-devel mailing list