[bitbake-devel] [PATCH 34/94] bitbake: webhob: determine if a build is an image
Alex DAMIAN
alexandru.damian at intel.com
Tue Sep 24 16:52:03 UTC 2013
From: Alexandru DAMIAN <alexandru.damian at intel.com>
Adding code to see if a build will generate a image
based on the inheritance of image.bbclass in the recipe
defining the build.
Signed-off-by: Alexandru DAMIAN <alexandru.damian at intel.com>
---
bitbake/lib/bb/ui/buildinfohelper.py | 4 ++++
bitbake/lib/webhob/bldviewer/templates/build.html | 2 ++
bitbake/lib/webhob/orm/models.py | 2 +-
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index 92f1621..16e69c5 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -328,6 +328,7 @@ class BuildInfoHelper(object):
build_information = self._get_build_information(machine_obj)
build_information['target'] = ' '.join(event.getPkgs())
+
build_obj = self.orm_wrapper.create_build_object(build_information)
self.internal_state['build'] = build_obj
self.internal_state['target'] = build_information['target']
@@ -422,6 +423,9 @@ class BuildInfoHelper(object):
recipe_info['file_path'] = file_name
recipe = self.orm_wrapper.get_update_recipe_object(recipe_info)
recipe.is_image = True in map(lambda x: x.endswith('image.bbclass'), event._depgraph['pn'][pn]['inherits'])
+ if recipe.is_image and pn == self.internal_state['build'].target:
+ self.internal_state['build'].is_image = True
+ self.internal_state['build'].save()
self.internal_state['recipes'][pn] = recipe
# save all task information
diff --git a/bitbake/lib/webhob/bldviewer/templates/build.html b/bitbake/lib/webhob/bldviewer/templates/build.html
index 1b694d6..cd257e0 100644
--- a/bitbake/lib/webhob/bldviewer/templates/build.html
+++ b/bitbake/lib/webhob/bldviewer/templates/build.html
@@ -16,6 +16,7 @@
<th>Started On</th>
<th>Completed On</th>
<th>Target</th>
+ <th>Image ?</th>
<th>Machine</th>
<th>Time</th>
<th>Errors</th>
@@ -33,6 +34,7 @@
<td>{{build.started_on}}</td>
<td>{{build.completed_on}}</td>
<td>{{build.target}}</td>
+ <td>{{build.is_image}}</td>
<td>{{build.machine.name}}</td>
<td>{% time_difference build.started_on build.completed_on %}</td>
<td>{{build.errors_no}}</td>
diff --git a/bitbake/lib/webhob/orm/models.py b/bitbake/lib/webhob/orm/models.py
index 91b352e..0d6cf15 100644
--- a/bitbake/lib/webhob/orm/models.py
+++ b/bitbake/lib/webhob/orm/models.py
@@ -14,7 +14,7 @@ class Build(models.Model):
uuid = models.CharField(max_length=100, unique=True)
target = models.CharField(max_length=100)
- is_image = models.BooleanField()
+ is_image = models.BooleanField(default = False)
machine = models.ForeignKey('Machine', related_name='build_machine')
distro = models.CharField(max_length=100)
distro_version = models.CharField(max_length=100)
--
1.8.1.2
More information about the bitbake-devel
mailing list