summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/ui/buildinfohelper.py4
-rw-r--r--bitbake/lib/toaster/orm/models.py13
2 files changed, 6 insertions, 11 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index 967e4bdca2..c0f42d2dcb 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -190,8 +190,8 @@ class ORMWrapper(object):
190 vars(task_object)[v] = task_information[v] 190 vars(task_object)[v] = task_information[v]
191 object_changed = True 191 object_changed = True
192 192
193 # update setscene-related information if the task was just created 193 # update setscene-related information if the task has a setscene
194 if created and task_object.outcome == Task.OUTCOME_COVERED and 1 == Task.objects.related_setscene(task_object).count(): 194 if task_object.outcome == Task.OUTCOME_COVERED and 1 == task_object.get_related_setscene().count():
195 task_object.outcome = Task.OUTCOME_CACHED 195 task_object.outcome = Task.OUTCOME_CACHED
196 object_changed = True 196 object_changed = True
197 197
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index d2b579f90b..03efac4943 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -281,10 +281,6 @@ class Target_File(models.Model):
281 sym_target = models.ForeignKey('Target_File', related_name="symlink_set", null=True) 281 sym_target = models.ForeignKey('Target_File', related_name="symlink_set", null=True)
282 282
283 283
284class TaskManager(models.Manager):
285 def related_setscene(self, task_object):
286 return Task.objects.filter(task_executed=True, build = task_object.build, recipe = task_object.recipe, task_name=task_object.task_name+"_setscene")
287
288class Task(models.Model): 284class Task(models.Model):
289 285
290 SSTATE_NA = 0 286 SSTATE_NA = 0
@@ -339,10 +335,8 @@ class Task(models.Model):
339 335
340 search_allowed_fields = [ "recipe__name", "recipe__version", "task_name", "logfile" ] 336 search_allowed_fields = [ "recipe__name", "recipe__version", "task_name", "logfile" ]
341 337
342 objects = TaskManager()
343
344 def get_related_setscene(self): 338 def get_related_setscene(self):
345 return Task.objects.related_setscene(self) 339 return Task.objects.filter(task_executed=True, build = self.build, recipe = self.recipe, task_name=self.task_name+"_setscene")
346 340
347 def get_outcome_text(self): 341 def get_outcome_text(self):
348 return Task.TASK_OUTCOME[self.outcome + 1][1] 342 return Task.TASK_OUTCOME[self.outcome + 1][1]
@@ -377,7 +371,7 @@ class Task(models.Model):
377 outcome = models.IntegerField(choices=TASK_OUTCOME, default=OUTCOME_NA) 371 outcome = models.IntegerField(choices=TASK_OUTCOME, default=OUTCOME_NA)
378 sstate_checksum = models.CharField(max_length=100, blank=True) 372 sstate_checksum = models.CharField(max_length=100, blank=True)
379 path_to_sstate_obj = models.FilePathField(max_length=500, blank=True) 373 path_to_sstate_obj = models.FilePathField(max_length=500, blank=True)
380 recipe = models.ForeignKey('Recipe', related_name='build_recipe') 374 recipe = models.ForeignKey('Recipe', related_name='tasks')
381 task_name = models.CharField(max_length=100) 375 task_name = models.CharField(max_length=100)
382 source_url = models.FilePathField(max_length=255, blank=True) 376 source_url = models.FilePathField(max_length=255, blank=True)
383 work_directory = models.FilePathField(max_length=255, blank=True) 377 work_directory = models.FilePathField(max_length=255, blank=True)
@@ -394,7 +388,8 @@ class Task(models.Model):
394 sstate_text = property(get_sstate_text) 388 sstate_text = property(get_sstate_text)
395 389
396 def __unicode__(self): 390 def __unicode__(self):
397 return "%d %s:%s" % (self.id, self.recipe.name, self.task_name) 391 return "%d(%d) %s:%s" % (self.pk, self.build.pk, self.recipe.name, self.task_name)
392
398 class Meta: 393 class Meta:
399 ordering = ('order', 'recipe' ,) 394 ordering = ('order', 'recipe' ,)
400 unique_together = ('build', 'recipe', 'task_name', ) 395 unique_together = ('build', 'recipe', 'task_name', )