[oe-commits] [bitbake] 39/40: toaster: bldcontrol model BRLayer Add corresponding local_source_dir

git at git.openembedded.org git at git.openembedded.org
Wed Aug 10 23:12:22 UTC 2016


rpurdie pushed a commit to branch master
in repository bitbake.

commit a3112c922f036425977abffa0137b9133f61fcd6
Author: Michael Wood <michael.g.wood at intel.com>
AuthorDate: Mon Aug 8 15:11:27 2016 +0100

    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.
    
    Signed-off-by: Michael Wood <michael.g.wood at intel.com>
---
 .../migrations/0006_brlayer_local_source_dir.py       | 19 +++++++++++++++++++
 lib/toaster/bldcontrol/models.py                      |  1 +
 lib/toaster/orm/models.py                             | 10 +++++++++-
 3 files changed, 29 insertions(+), 1 deletion(-)

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
index 0000000..2460002
--- /dev/null
+++ b/lib/toaster/bldcontrol/migrations/0006_brlayer_local_source_dir.py
@@ -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),
+        ),
+    ]
diff --git a/lib/toaster/bldcontrol/models.py b/lib/toaster/bldcontrol/models.py
index f055480..83b6969 100644
--- a/lib/toaster/bldcontrol/models.py
+++ b/lib/toaster/bldcontrol/models.py
@@ -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)
diff --git a/lib/toaster/orm/models.py b/lib/toaster/orm/models.py
index 432b51e..3aeb4e2 100644
--- a/lib/toaster/orm/models.py
+++ b/lib/toaster/orm/models.py
@@ -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()

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list