From cca517056bd2a195f33a7f2945df38af1a17abdd Mon Sep 17 00:00:00 2001 From: Alexandru DAMIAN Date: Wed, 4 Mar 2015 15:52:01 +0000 Subject: bitbake: toasterui: identify proper layer in build mode In build mode, instead of creating our own layer objects, we identify the layer objects that the build system set up. [YOCTO #7378] (Bitbake rev: 22962b540ace6868cb357c0fd13f01ffd24449c4) Signed-off-by: Alexandru DAMIAN Signed-off-by: Richard Purdie --- bitbake/lib/toaster/bldcontrol/localhostbecontroller.py | 4 ++-- bitbake/lib/toaster/orm/models.py | 10 ++-------- 2 files changed, 4 insertions(+), 10 deletions(-) (limited to 'bitbake/lib/toaster') diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py index 25ce0522b5..aef9b60cba 100644 --- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py +++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py @@ -180,7 +180,7 @@ class LocalhostBEController(BuildEnvironmentController): base = components[-2] if components[-1] == "git" else components[-1] if branch != "HEAD": - return "_%s_%s.toaster_cloned" % (base, branch) + return os.path.join(self.be.sourcedir, "_%s_%s.toaster_cloned" % (base, branch)) # word of attention; this is a localhost-specific issue; only on the localhost we expect to have "HEAD" releases @@ -239,7 +239,7 @@ class LocalhostBEController(BuildEnvironmentController): # 3. checkout the repositories for giturl, commit in gitrepos.keys(): - localdirname = os.path.join(self.be.sourcedir, self.getGitCloneDirectory(giturl, commit)) + localdirname = self.getGitCloneDirectory(giturl, commit) logger.debug("localhostbecontroller: giturl %s:%s checking out in current directory %s" % (giturl, commit, localdirname)) # make sure our directory is a git repository diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index 4d1dcbc9f3..80e6d9288c 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py @@ -195,14 +195,8 @@ class Project(models.Model): dirpath = self.bitbake_version.dirpath) for l in self.projectlayer_set.all().order_by("pk"): - commit = l.layercommit.commit - print("ii Building layer ", l.layercommit.layer.name, " at commit ", commit) - if l.layercommit.up_branch: - commit = l.layercommit.up_branch.name - print("ii Building layer ", l.layercommit.layer.name, " at upbranch ", commit) - if l.layercommit.branch: - commit = l.layercommit.branch - print("ii Building layer ", l.layercommit.layer.name, " at actual_branch ", commit) + commit = l.layercommit.get_vcs_reference() + print("ii Building layer ", l.layercommit.layer.name, " at vcs point ", commit) BRLayer.objects.create(req = br, name = l.layercommit.layer.name, giturl = l.layercommit.layer.vcs_url, commit = commit, dirpath = l.layercommit.dirpath) for t in self.projecttarget_set.all(): BRTarget.objects.create(req = br, target = t.target, task = t.task) -- cgit v1.2.3-54-g00ecf