]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
toaster: set varibales on bitbake server
authorEd Bartosh <ed.bartosh@linux.intel.com>
Wed, 2 Dec 2015 18:02:54 +0000 (10:02 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 7 Dec 2015 17:22:59 +0000 (17:22 +0000)
Set project variables using connection to bitbake server
instead of writing them to toaster configuration files.

This is a way to avoid rewriting configuration files before
and after every build, triggered by toaster UI.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/toaster/bldcontrol/localhostbecontroller.py

index 19afb1ada50c2ef655fb64e6b3b94090150c8ce4..efba73e769fe5d57d80cfa653a0679e6784e4b9e 100644 (file)
@@ -291,12 +291,19 @@ class LocalhostBEController(BuildEnvironmentController):
     def triggerBuild(self, bitbake, layers, variables, targets):
         # set up the buid environment with the needed layers
         self.setLayers(bitbake, layers, targets)
-        self.writeConfFile("conf/toaster-pre.conf", variables)
-        self.writeConfFile("conf/toaster.conf", raw = "INHERIT+=\"toaster buildhistory\"")
 
         # get the bb server running with the build req id and build env id
         bbctrl = self.getBBController()
 
+        # set variables
+        for var in variables:
+            bbctrl.setVariable(var.name, var.value)
+
+        # Add 'toaster' and 'buildhistory' to INHERIT variable
+        inherit = {item.strip() for item in bbctrl.getVariable('INHERIT').split()}
+        inherit = inherit.union(["toaster", "buildhistory"])
+        bbctrl.setVariable('INHERIT', ' '.join(inherit))
+
         # trigger the build command
         task = reduce(lambda x, y: x if len(y)== 0 else y, map(lambda y: y.task, targets))
         if len(task) == 0: