aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2008-03-13 22:27:20 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2008-03-13 22:27:20 +0000
commitcabc373a669801b0bbee6cf74a17c00796948ca1 (patch)
treededc1d06ddc2d6248998cc76b1ad5e6f9b6d28dc
parenta86ac9e2f8932e5a1ec7596b5129ae7b6fe5349b (diff)
downloadbitbake-cabc373a669801b0bbee6cf74a17c00796948ca1.tar.gz
runqueue.py: Switch to check_stamp code since its simpler than check_stamps and accounts for tasks which adjust other stamps in the system such as packaged staging. The drawback is we can't 'accelerate' task numbers to get an accurate idea of how many tasks will run
-rw-r--r--lib/bb/runqueue.py46
1 files changed, 37 insertions, 9 deletions
diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index 5d0bd5aba..7c3ea31cf 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -751,6 +751,40 @@ class RunQueue:
bb.fatal("check_stamps fatal internal error")
return current
+ def check_stamp(self, task):
+
+ if self.stamppolicy == "perfile":
+ fulldeptree = False
+ else:
+ fulldeptree = True
+
+ fn = self.taskData.fn_index[self.runq_fnid[task]]
+ taskname = self.runq_task[task]
+ stampfile = "%s.%s" % (self.dataCache.stamp[fn], taskname)
+ # If the stamp is missing its not current
+ if not os.access(stampfile, os.F_OK):
+ return False
+ # If its a 'nostamp' task, it's not current
+ taskdep = self.dataCache.task_deps[fn]
+ if 'nostamp' in taskdep and task in taskdep['nostamp']:
+ return False
+
+ iscurrent = True
+ t1 = os.stat(stampfile)[stat.ST_MTIME]
+ for dep in self.runq_depends[task]:
+ if iscurrent:
+ fn2 = self.taskData.fn_index[self.runq_fnid[dep]]
+ taskname2 = self.runq_task[dep]
+ stampfile2 = "%s.%s" % (self.dataCache.stamp[fn2], taskname2)
+ if fulldeptree or fn == fn2:
+ try:
+ t2 = os.stat(stampfile2)[stat.ST_MTIME]
+ if t1 < t2:
+ iscurrent = False
+ except:
+ iscurrent = False
+
+ return iscurrent
def execute_runqueue(self):
"""
@@ -815,12 +849,6 @@ class RunQueue:
event.fire(bb.event.StampUpdate(self.target_pairs, self.dataCache.stamp, self.cfgdata))
- # Find out which tasks have current stamps which we can skip when the
- # time comes
- self.currentstamps = self.check_stamps()
- self.stats.taskSkipped(len(self.currentstamps))
- self.stats.taskCompleted(len(self.currentstamps))
-
def task_complete(self, task):
"""
Mark a task as completed
@@ -874,13 +902,13 @@ class RunQueue:
fn = self.taskData.fn_index[self.runq_fnid[task]]
taskname = self.runq_task[task]
- if task in self.currentstamps:
+ if self.check_stamp(task):
bb.msg.debug(2, bb.msg.domain.RunQueue, "Stamp current task %s (%s)" % (task, self.get_user_idstring(task)))
self.runq_running[task] = 1
self.runq_buildable[task] = 1
self.task_complete(task)
- #self.stats.taskCompleted()
- #self.stats.taskSkipped()
+ self.stats.taskCompleted()
+ self.stats.taskSkipped()
continue
bb.event.fire(runQueueTaskStarted(task, self.stats, self, self.cfgData))