summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2016-08-08 15:11:27 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-11 00:09:29 +0100
commit4ac57fb73e623048756c572b93d12893a5a67414 (patch)
treef6bd73fd3ff5457d1b87f0c7564f32c0fef80f51 /bitbake/lib/toaster
parentcb5ed74e7f1cb174724874a7142fc56be5c6d02d (diff)
downloadpoky-4ac57fb73e623048756c572b93d12893a5a67414.tar.gz
bitbake: toaster: bldcontrol model BRLayer Add corresponding local_source_dir
Sync the BRLayer object with the new field added to the Layer object. The BRLayer (BuildRequest Layers) are snapshots of the layers in the project at build time and therefore need to mirror the required fields of the layer object. (Bitbake rev: a3112c922f036425977abffa0137b9133f61fcd6) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster')
-rw-r--r--bitbake/lib/toaster/bldcontrol/migrations/0006_brlayer_local_source_dir.py19
-rw-r--r--bitbake/lib/toaster/bldcontrol/models.py1
-rw-r--r--bitbake/lib/toaster/orm/models.py10
3 files changed, 29 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/migrations/0006_brlayer_local_source_dir.py b/bitbake/lib/toaster/bldcontrol/migrations/0006_brlayer_local_source_dir.py
new file mode 100644
index 0000000000..2460002f07
--- /dev/null
+++ b/bitbake/lib/toaster/bldcontrol/migrations/0006_brlayer_local_source_dir.py
@@ -0,0 +1,19 @@
1# -*- coding: utf-8 -*-
2from __future__ import unicode_literals
3
4from django.db import migrations, models
5
6
7class Migration(migrations.Migration):
8
9 dependencies = [
10 ('bldcontrol', '0005_reorder_buildrequest_states'),
11 ]
12
13 operations = [
14 migrations.AddField(
15 model_name='brlayer',
16 name='local_source_dir',
17 field=models.CharField(max_length=254, null=True),
18 ),
19 ]
diff --git a/bitbake/lib/toaster/bldcontrol/models.py b/bitbake/lib/toaster/bldcontrol/models.py
index f055480686..83b696947f 100644
--- a/bitbake/lib/toaster/bldcontrol/models.py
+++ b/bitbake/lib/toaster/bldcontrol/models.py
@@ -130,6 +130,7 @@ class BRLayer(models.Model):
130 req = models.ForeignKey(BuildRequest) 130 req = models.ForeignKey(BuildRequest)
131 name = models.CharField(max_length = 100) 131 name = models.CharField(max_length = 100)
132 giturl = models.CharField(max_length = 254) 132 giturl = models.CharField(max_length = 254)
133 local_source_dir = models.CharField(max_length=254, null=True)
133 commit = models.CharField(max_length = 254) 134 commit = models.CharField(max_length = 254)
134 dirpath = models.CharField(max_length = 254) 135 dirpath = models.CharField(max_length = 254)
135 layer_version = models.ForeignKey(Layer_Version, null=True) 136 layer_version = models.ForeignKey(Layer_Version, null=True)
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index 432b51e0e1..3aeb4e223d 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -346,7 +346,15 @@ class Project(models.Model):
346 for l in self.projectlayer_set.all().order_by("pk"): 346 for l in self.projectlayer_set.all().order_by("pk"):
347 commit = l.layercommit.get_vcs_reference() 347 commit = l.layercommit.get_vcs_reference()
348 print("ii Building layer ", l.layercommit.layer.name, " at vcs point ", commit) 348 print("ii Building layer ", l.layercommit.layer.name, " at vcs point ", commit)
349 BRLayer.objects.create(req = br, name = l.layercommit.layer.name, giturl = l.layercommit.layer.vcs_url, commit = commit, dirpath = l.layercommit.dirpath, layer_version=l.layercommit) 349 BRLayer.objects.create(
350 req=br,
351 name=l.layercommit.layer.name,
352 giturl=l.layercommit.layer.vcs_url,
353 commit=commit,
354 dirpath=l.layercommit.dirpath,
355 layer_version=l.layercommit,
356 local_source_dir=l.layercommit.layer.local_source_dir
357 )
350 358
351 br.state = BuildRequest.REQ_QUEUED 359 br.state = BuildRequest.REQ_QUEUED
352 now = timezone.now() 360 now = timezone.now()