]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
toaster: bldcontrol model BRLayer Add corresponding local_source_dir
authorMichael Wood <michael.g.wood@intel.com>
Mon, 8 Aug 2016 14:11:27 +0000 (15:11 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 10 Aug 2016 23:08:18 +0000 (00:08 +0100)
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.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
lib/toaster/bldcontrol/migrations/0006_brlayer_local_source_dir.py [new file with mode: 0644]
lib/toaster/bldcontrol/models.py
lib/toaster/orm/models.py

diff --git a/lib/toaster/bldcontrol/migrations/0006_brlayer_local_source_dir.py b/lib/toaster/bldcontrol/migrations/0006_brlayer_local_source_dir.py
new file mode 100644 (file)
index 0000000..2460002
--- /dev/null
@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('bldcontrol', '0005_reorder_buildrequest_states'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='brlayer',
+            name='local_source_dir',
+            field=models.CharField(max_length=254, null=True),
+        ),
+    ]
index f05548068612ea26006dc01738982854bfc3f317..83b696947f201b4047109c76da5ab9b5f03fb539 100644 (file)
@@ -130,6 +130,7 @@ class BRLayer(models.Model):
     req         = models.ForeignKey(BuildRequest)
     name        = models.CharField(max_length = 100)
     giturl      = models.CharField(max_length = 254)
+    local_source_dir = models.CharField(max_length=254, null=True)
     commit      = models.CharField(max_length = 254)
     dirpath     = models.CharField(max_length = 254)
     layer_version = models.ForeignKey(Layer_Version, null=True)
index 432b51e0e1d5301b40e92857b505ece306af3329..3aeb4e223dcee4e704fc6015e9aeee61aab1ac80 100644 (file)
@@ -346,7 +346,15 @@ class Project(models.Model):
             for l in self.projectlayer_set.all().order_by("pk"):
                 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, layer_version=l.layercommit)
+                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,
+                    local_source_dir=l.layercommit.layer.local_source_dir
+                )
 
             br.state = BuildRequest.REQ_QUEUED
             now = timezone.now()