summaryrefslogtreecommitdiff
path: root/bitbake/lib/bb/cache.py
diff options
context:
space:
mode:
authorBob Foerster <rfoerster@layerzero.com>2010-11-22 10:13:56 -0500
committerRichard Purdie <rpurdie@linux.intel.com>2011-01-04 14:46:51 +0000
commit2735a70ece44fa55282fb99e4f63c4ac269b07ac (patch)
treebca01db2dee721a0cfe8924f916d2ca16ba0a541 /bitbake/lib/bb/cache.py
parent89a1b59d9a0c2ba7ec62dad41822dd7fdd831a81 (diff)
downloadopenembedded-core-2735a70ece44fa55282fb99e4f63c4ac269b07ac.tar.gz
openembedded-core-2735a70ece44fa55282fb99e4f63c4ac269b07ac.tar.bz2
openembedded-core-2735a70ece44fa55282fb99e4f63c4ac269b07ac.zip
Show the user progress when loading the cache
(Bitbake rev: bdd7813d8eecf7b6b636322e748ca6bf69118513) Signed-off-by: Bob Foerster <robert@erafx.com> Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/cache.py')
-rw-r--r--bitbake/lib/bb/cache.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py
index b3c632b81c..fb02deb8ef 100644
--- a/bitbake/lib/bb/cache.py
+++ b/bitbake/lib/bb/cache.py
@@ -204,14 +204,31 @@ class Cache(object):
logger.info('Bitbake version mismatch, rebuilding...')
return
+ cachesize = os.fstat(cachefile.fileno()).st_size
+ bb.event.fire(bb.event.CacheLoadStarted(cachesize), self.data)
+
+ previous_percent = 0
while cachefile:
try:
key = pickled.load()
value = pickled.load()
except Exception:
break
+
self.depends_cache[key] = value
+ # only fire events on even percentage boundaries
+ current_progress = cachefile.tell()
+ current_percent = 100 * current_progress / cachesize
+ if current_percent > previous_percent:
+ previous_percent = current_percent
+ bb.event.fire(bb.event.CacheLoadProgress(current_progress),
+ self.data)
+
+ bb.event.fire(bb.event.CacheLoadCompleted(cachesize,
+ len(self.depends_cache)),
+ self.data)
+
@staticmethod
def virtualfn2realfn(virtualfn):
"""