summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAwais Belal <awais_belal@mentor.com>2018-08-26 15:33:24 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-08-28 10:32:08 +0100
commit95e37ba260adee18cf16dd099a67f0a4fe22b7a9 (patch)
tree3dde9a80d37027caf346fcffc1faff6845bdf5b8
parentfd1da1ac6e7603159b589c9d85b4a26a4a6978a9 (diff)
downloadpoky-95e37ba260adee18cf16dd099a67f0a4fe22b7a9.tar.gz
bitbake: toaster: allow pokydirname to be evaluated when all layers are local
Toaster depends on pokydirname for identifying the location of the oe-init-build-env script (and there might be other purposes in the future). The problem with current approach is that it only checks/sets the variable with git based repos, whereas toaster provides mechanisms to allow having layers that are all locally available. The evaluation of the variable fails in such scenarios, so use a more flexible mechanism in this case and try to locate poky in the local layers as well, if not already set. [YOCTO #12891] (Bitbake rev: 6c3c196b28603591371ec7e62871fbb4296f2c71) Signed-off-by: Awais Belal <awais.belal@mentor.com> Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/toaster/bldcontrol/localhostbecontroller.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
index 6bdd743b8b..5df22909d0 100644
--- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -222,9 +222,21 @@ class LocalhostBEController(BuildEnvironmentController):
222 self.setCloneStatus(bitbake,'complete',clone_total,clone_count,'') 222 self.setCloneStatus(bitbake,'complete',clone_total,clone_count,'')
223 logger.debug("localhostbecontroller: current layer list %s " % pformat(layerlist)) 223 logger.debug("localhostbecontroller: current layer list %s " % pformat(layerlist))
224 224
225 if self.pokydirname is None and os.path.exists(os.path.join(self.be.sourcedir, "oe-init-build-env")): 225 # Resolve self.pokydirname if not resolved yet, consider the scenario
226 logger.debug("localhostbecontroller: selected poky dir name %s" % self.be.sourcedir) 226 # where all layers are local, that's the else clause
227 self.pokydirname = self.be.sourcedir 227 if self.pokydirname is None:
228 if os.path.exists(os.path.join(self.be.sourcedir, "oe-init-build-env")):
229 logger.debug("localhostbecontroller: selected poky dir name %s" % self.be.sourcedir)
230 self.pokydirname = self.be.sourcedir
231 else:
232 # Alternatively, scan local layers for relative "oe-init-build-env" location
233 for layer in layers:
234 if os.path.exists(os.path.join(layer.layer_version.layer.local_source_dir,"..","oe-init-build-env")):
235 logger.debug("localhostbecontroller, setting pokydirname to %s" % (layer.layer_version.layer.local_source_dir))
236 self.pokydirname = os.path.join(layer.layer_version.layer.local_source_dir,"..")
237 break
238 else:
239 logger.error("pokydirname is not set, you will run into trouble!")
228 240
229 # 5. create custom layer and add custom recipes to it 241 # 5. create custom layer and add custom recipes to it
230 for target in targets: 242 for target in targets: