aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2015-02-26 21:41:56 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-02-27 07:35:09 +0000
commit8a326a9a5a08981f1b7960e02fdb8a9436db16fb (patch)
tree0304dcfdcc5437aa6506c68e74d2da59b8bdad79
parent06294c5d3b512fb849fc1eedc9d5ea344f535bec (diff)
downloadbitbake-8a326a9a5a08981f1b7960e02fdb8a9436db16fb.tar.gz
toasterui: fix sstate task identification
This patch fixes a problem where set sstate scene tasks were not identified, causing cache attempt not being recorded. [YOCTO #7223] Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/ui/buildinfohelper.py4
-rw-r--r--lib/toaster/orm/models.py13
2 files changed, 6 insertions, 11 deletions
diff --git a/lib/bb/ui/buildinfohelper.py b/lib/bb/ui/buildinfohelper.py
index 967e4bdca..c0f42d2dc 100644
--- a/lib/bb/ui/buildinfohelper.py
+++ b/lib/bb/ui/buildinfohelper.py
@@ -190,8 +190,8 @@ class ORMWrapper(object):
vars(task_object)[v] = task_information[v]
object_changed = True
- # update setscene-related information if the task was just created
- if created and task_object.outcome == Task.OUTCOME_COVERED and 1 == Task.objects.related_setscene(task_object).count():
+ # update setscene-related information if the task has a setscene
+ if task_object.outcome == Task.OUTCOME_COVERED and 1 == task_object.get_related_setscene().count():
task_object.outcome = Task.OUTCOME_CACHED
object_changed = True
diff --git a/lib/toaster/orm/models.py b/lib/toaster/orm/models.py
index d2b579f90..03efac494 100644
--- a/lib/toaster/orm/models.py
+++ b/lib/toaster/orm/models.py
@@ -281,10 +281,6 @@ class Target_File(models.Model):
sym_target = models.ForeignKey('Target_File', related_name="symlink_set", null=True)
-class TaskManager(models.Manager):
- def related_setscene(self, task_object):
- return Task.objects.filter(task_executed=True, build = task_object.build, recipe = task_object.recipe, task_name=task_object.task_name+"_setscene")
-
class Task(models.Model):
SSTATE_NA = 0
@@ -339,10 +335,8 @@ class Task(models.Model):
search_allowed_fields = [ "recipe__name", "recipe__version", "task_name", "logfile" ]
- objects = TaskManager()
-
def get_related_setscene(self):
- return Task.objects.related_setscene(self)
+ return Task.objects.filter(task_executed=True, build = self.build, recipe = self.recipe, task_name=self.task_name+"_setscene")
def get_outcome_text(self):
return Task.TASK_OUTCOME[self.outcome + 1][1]
@@ -377,7 +371,7 @@ class Task(models.Model):
outcome = models.IntegerField(choices=TASK_OUTCOME, default=OUTCOME_NA)
sstate_checksum = models.CharField(max_length=100, blank=True)
path_to_sstate_obj = models.FilePathField(max_length=500, blank=True)
- recipe = models.ForeignKey('Recipe', related_name='build_recipe')
+ recipe = models.ForeignKey('Recipe', related_name='tasks')
task_name = models.CharField(max_length=100)
source_url = models.FilePathField(max_length=255, blank=True)
work_directory = models.FilePathField(max_length=255, blank=True)
@@ -394,7 +388,8 @@ class Task(models.Model):
sstate_text = property(get_sstate_text)
def __unicode__(self):
- return "%d %s:%s" % (self.id, self.recipe.name, self.task_name)
+ return "%d(%d) %s:%s" % (self.pk, self.build.pk, self.recipe.name, self.task_name)
+
class Meta:
ordering = ('order', 'recipe' ,)
unique_together = ('build', 'recipe', 'task_name', )