self.be = be
self.connection = None
- @staticmethod
- def _updateBBLayers(bblayerconf, layerlist):
- conflines = open(bblayerconf, "r").readlines()
-
- bblayerconffile = open(bblayerconf, "w")
- skip = 0
- for i in xrange(len(conflines)):
- if skip > 0:
- skip =- 1
- continue
- if conflines[i].startswith("# line added by toaster"):
- skip = 1
- else:
- bblayerconffile.write(conflines[i])
-
- bblayerconffile.write("# line added by toaster build control\nBBLAYERS = \"" + " ".join(layerlist) + "\"")
- bblayerconffile.close()
-
def setLayers(self, bitbake, ls):
""" Checks-out bitbake executor and layers from git repositories.
Sets the layer variables in the config file, after validating local layer paths.
logger.debug("localhostbecontroller: current layer list %s " % pformat(layerlist))
- # 4. update the bblayers.conf
- bblayerconf = os.path.join(self.be.builddir, "conf/bblayers.conf")
- if not os.path.exists(bblayerconf):
- raise BuildSetupException("BE is not consistent: bblayers.conf file missing at %s" % bblayerconf)
-
# 5. create custom layer and add custom recipes to it
layerpath = os.path.join(self.be.builddir,
CustomImageRecipe.LAYER_NAME)
if os.path.isdir(layerpath):
layerlist.append(layerpath)
- BuildEnvironmentController._updateBBLayers(bblayerconf, layerlist)
-
self.islayerset = True
- return True
+ return layerlist
def readServerLogFile(self):
return open(os.path.join(self.be.builddir, "toaster_server.log"), "r").read()