]> code.ossystems Code Review - openembedded-core.git/commitdiff
cache: defer marking fn as clean
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Mon, 3 Jan 2011 19:57:22 +0000 (20:57 +0100)
committerRichard Purdie <rpurdie@linux.intel.com>
Tue, 4 Jan 2011 15:00:18 +0000 (15:00 +0000)
Only mark fn as clean if it is clean.
This saves us from removing (prematurely added) fn from our clean set
and saves me a few percent of runtime (and misleading debugging output
from remove()).

(Bitbake rev: 884365228fcaac07421ac1440d4946693fb628c5)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
bitbake/lib/bb/cache.py

index 2f89350763948357c75a7ed720157b881fe1843c..c477501d686b1f4887af1a1c12801ea8b6f19695 100644 (file)
@@ -347,13 +347,9 @@ class Cache(object):
 
         self.checked.add(fn)
 
-        # Pretend we're clean so getVar works
-        self.clean.add(fn)
-
         # File isn't in depends_cache
         if not fn in self.depends_cache:
             logger.debug(2, "Cache: %s is not cached", fn)
-            self.remove(fn)
             return False
 
         mtime = bb.parse.cached_mtime_noerror(fn)
@@ -409,6 +405,7 @@ class Cache(object):
                 self.clean.remove(fn)
             return False
 
+        self.clean.add(fn)
         return True
 
     def remove(self, fn):