The "Output" column is filled with IMAGE_FSTYPES value when the outcome is Succeeded and the build includes at least one image recipe among its targets. I've changes the place of image_fstypes, because it is related to machine, so it is related to build. For all the image targets, IMAGE_FSTYPES has the same value. Implement a method to remove the redundant entities in a string, which is used when you get IMAGE_FSTYPES from bitbake.
[YOCTO #5188] Signed-off-by: Cristiana Voicu <[email protected]> --- bitbake/lib/bb/ui/buildinfohelper.py | 11 +++++++++-- bitbake/lib/webhob/bldviewer/templates/build.html | 2 +- bitbake/lib/webhob/orm/models.py | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py index d53845e..4902474 100644 --- a/bitbake/lib/bb/ui/buildinfohelper.py +++ b/bitbake/lib/bb/ui/buildinfohelper.py @@ -44,6 +44,7 @@ class ORMWrapper(object): build = Build.objects.create( machine=build_info['machine'], + image_fstypes=build_info['image_fstypes'], distro=build_info['distro'], distro_version=build_info['distro_version'], started_on=build_info['started_on'], @@ -60,7 +61,6 @@ class ORMWrapper(object): tgt_object = Target.objects.create( build = target_info['build'], target = tgt_name, is_image = False, - image_fstypes = "", file_name = "", file_size = 0); targets.append(tgt_object) @@ -328,7 +328,7 @@ class BuildInfoHelper(object): build_info['distro_version'] = self.server.runCommand(["getVariable", "DISTRO_VERSION"])[0] build_info['started_on'] = datetime.datetime.now() build_info['completed_on'] = datetime.datetime.now() - build_info['image_fstypes'] = self.server.runCommand(["getVariable", "IMAGE_FSTYPES"])[0] + build_info['image_fstypes'] = self._remove_redundant(self.server.runCommand(["getVariable", "IMAGE_FSTYPES"])[0] or "") build_info['cooker_log_path'] = self.server.runCommand(["getVariable", "BB_CONSOLELOG"])[0] build_info['build_name'] = self.server.runCommand(["getVariable", "BUILDNAME"])[0] build_info['bitbake_version'] = self.server.runCommand(["getVariable", "BB_VERSION"])[0] @@ -427,6 +427,13 @@ class BuildInfoHelper(object): return task_build_stats + def _remove_redundant(self, string): + ret = [] + for i in string.split(): + if i not in ret: + ret.append(i) + return " ".join(ret) + ################################ ## external available methods to store information diff --git a/bitbake/lib/webhob/bldviewer/templates/build.html b/bitbake/lib/webhob/bldviewer/templates/build.html index 2ff02bb..ef4a5f7 100644 --- a/bitbake/lib/webhob/bldviewer/templates/build.html +++ b/bitbake/lib/webhob/bldviewer/templates/build.html @@ -31,7 +31,7 @@ <td>{% time_difference build.started_on build.completed_on %}</td> <td>{{build.errors_no}}:{% if build.errors_no %}{% for error in logs %}{% if error.build == build %}{% if error.level == 2 %}<p>{{error.message}}</p>{% endif %}{% endif %}{% endfor %}{% else %}None{% endif %}</td> <td>{{build.warnings_no}}:{% if build.warnings_no %}{% for warning in logs %}{% if warning.build == build %}{% if warning.level == 1 %}<p>{{warning.message}}</p>{% endif %}{% endif %}{% endfor %}{% else %}None{% endif %}</td> - <td>{{build.image_fstypes}}</td> + <td>{% if build.outcome == 0 %}{% for t in build.target_set.all %}{% if t.is_image %}{{build.image_fstypes}}{% endif %}{% endfor %}{% endif %}</td> <td>{{build.cooker_log_path}}</td> <td>{{build.bitbake_version}}</td> <td>{{build.build_name}}</td> diff --git a/bitbake/lib/webhob/orm/models.py b/bitbake/lib/webhob/orm/models.py index 2ce226c..7b44a73 100644 --- a/bitbake/lib/webhob/orm/models.py +++ b/bitbake/lib/webhob/orm/models.py @@ -35,6 +35,7 @@ class Build(models.Model): 'cooker_log_path'] machine = models.CharField(max_length=100) + image_fstypes = models.CharField(max_length=100) distro = models.CharField(max_length=100) distro_version = models.CharField(max_length=100) started_on = models.DateTimeField() @@ -52,7 +53,6 @@ class Target(models.Model): build = models.ForeignKey(Build) target = models.CharField(max_length=100) is_image = models.BooleanField(default = False) - image_fstypes = models.CharField(max_length=100) file_name = models.CharField(max_length=100) file_size = models.IntegerField() -- 1.7.9.5 _______________________________________________ webhob mailing list [email protected] https://lists.yoctoproject.org/listinfo/webhob
