toaster.lists.yoctoproject.org archive mirror
 help / color / mirror / Atom feed
* [sumo][PATCH 1/8] toaster: allow pokydirname to be evaluated when all layers are local
@ 2018-07-06 10:43 Awais Belal
  2018-07-06 10:43 ` [sumo][PATCH 2/8] toaster: use a more flexible way to find bitbake Awais Belal
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Awais Belal @ 2018-07-06 10:43 UTC (permalink / raw)
  To: toaster

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 mechanism to allow having layers that are all
locally available the evaluation of the variable fails in such
scenarios so we use a more flexible mechanism in this case and
try to locate poky in the local layers as well if not already
set.

Signed-off-by: Awais Belal <awais_belal@mentor.com>
Signed-off-by: David Reyna <David.Reyna@windriver.com>
---
 .../lib/toaster/bldcontrol/localhostbecontroller.py    | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
index 16c7c80..f960a38 100644
--- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -217,9 +217,21 @@ class LocalhostBEController(BuildEnvironmentController):
         self.setCloneStatus(bitbake,'complete',clone_total,clone_count)
         logger.debug("localhostbecontroller: current layer list %s " % pformat(layerlist))
 
-        if self.pokydirname is None and os.path.exists(os.path.join(self.be.sourcedir, "oe-init-build-env")):
-            logger.debug("localhostbecontroller: selected poky dir name %s" % self.be.sourcedir)
-            self.pokydirname = self.be.sourcedir
+        # Resolve self.pokydirname if not resolved yet, consider the scenario
+        # where all layers are local, that's the else clause
+        if self.pokydirname is None:
+            if os.path.exists(os.path.join(self.be.sourcedir, "oe-init-build-env")):
+                logger.debug("localhostbecontroller: selected poky dir name %s" % self.be.sourcedir)
+                self.pokydirname = self.be.sourcedir
+            else:
+                # Alternatively, scan local layers for relative "oe-init-build-env" location
+                for layer in layers:
+                    if os.path.exists(os.path.join(layer.layer_version.layer.local_source_dir,"..","oe-init-build-env")):
+                        logger.debug("localhostbecontroller, setting pokydirname to %s" % (layer.layer_version.layer.local_source_dir))
+                        self.pokydirname = os.path.join(layer.layer_version.layer.local_source_dir,"..")
+                        break
+                else:
+                    logger.error("pokydirname is not set, you will run into trouble!")
 
         # 5. create custom layer and add custom recipes to it
         for target in targets:
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-07-06 10:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-06 10:43 [sumo][PATCH 1/8] toaster: allow pokydirname to be evaluated when all layers are local Awais Belal
2018-07-06 10:43 ` [sumo][PATCH 2/8] toaster: use a more flexible way to find bitbake Awais Belal
2018-07-06 10:43 ` [sumo][PATCH 3/8] toaster: allow TOASTER_DIR to be overridden from cmdline Awais Belal
2018-07-06 10:43 ` [sumo][PATCH 4/8] toaster/widgets.py: avoid divide by zero issues Awais Belal
2018-07-06 10:43 ` [sumo][PATCH 5/8] toastergui/newproject.html: fix release divs Awais Belal
2018-07-06 10:43 ` [sumo][PATCH 6/8] toaster/checksettings: allow CUSTOM_XML_ONLY setting through env Awais Belal
2018-07-06 10:43 ` [sumo][PATCH 7/8] toaster/models.py: allow local paths for custom recipe's base Awais Belal
2018-07-06 10:43 ` [sumo][PATCH 8/8] toaster/layerdetails.js: don't hide local layer info Awais Belal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).