From afe85485fe185b663a1285b5c27de3160bf06cf7 Mon Sep 17 00:00:00 2001 From: Alexandru DAMIAN Date: Wed, 28 Jan 2015 13:18:09 +0000 Subject: bitbake: toaster: new layer checkout logic This patch implements a new layer checkout logic that brings more flexibility in getting layers under different commits work with Toaster. The new hibrid logic will checkout separately each layer and commit id; the task execution will be delegated to the checkedout bitbake, but the data logger will be executed from the current toaster version as to bring in enough data to sustain the updates in UI models. [YOCTO #7171] [YOCTO #6892] (Bitbake rev: c6eb0f7f16c59530c2525b2e5629fe86de4e8f0f) Signed-off-by: Alexandru DAMIAN Signed-off-by: Richard Purdie --- bitbake/lib/toaster/bldcontrol/bbcontroller.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'bitbake/lib/toaster/bldcontrol/bbcontroller.py') diff --git a/bitbake/lib/toaster/bldcontrol/bbcontroller.py b/bitbake/lib/toaster/bldcontrol/bbcontroller.py index 102606e929..dbfb2f3a04 100644 --- a/bitbake/lib/toaster/bldcontrol/bbcontroller.py +++ b/bitbake/lib/toaster/bldcontrol/bbcontroller.py @@ -81,12 +81,17 @@ def getBuildEnvironmentController(**kwargs): raise Exception("FIXME: Implement BEC for type %s" % str(be.betype)) -def _getgitcheckoutdirectoryname(url): +def _get_git_clonedirectory(url, branch): """ Utility that returns the last component of a git path as directory """ import re components = re.split(r'[:\.\/]', url) - return components[-2] if components[-1] == "git" else components[-1] + base = components[-2] if components[-1] == "git" else components[-1] + + if branch != "HEAD": + return "_%s_%s.toaster_cloned" % (base, branch) + + return base class BuildEnvironmentController(object): @@ -166,12 +171,12 @@ class BuildEnvironmentController(object): raise Exception("Must override setLayers") - def getBBController(self, brbe): + def getBBController(self): """ returns a BitbakeController to an already started server; this is the point where the server starts if needed; or reconnects to the server if we can """ if not self.connection: - self.startBBServer(brbe) + self.startBBServer() self.be.lock = BuildEnvironment.LOCK_RUNNING self.be.save() -- cgit v1.2.3-54-g00ecf