]> code.ossystems Code Review - openembedded-core.git/commitdiff
bb.cache: only log if the respective action was taken
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Sat, 13 Nov 2010 23:36:37 +0000 (00:36 +0100)
committerRichard Purdie <rpurdie@linux.intel.com>
Tue, 4 Jan 2011 14:46:39 +0000 (14:46 +0000)
This avoids alot of misleading log-messages like "Removing FOO from cache"
if FOO was not in the cache and as such is not a removal candidate.

(Bitbake rev: de34a403e206867e09410ad4925c7b9cff04fee6)

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 9b1003baf1687d416c0cf7d8fd60bd6baf4a5a40..51eb3b82f7cbb5002b196d7dc6efbe073b341e89 100644 (file)
@@ -298,10 +298,12 @@ class Cache:
         if invalid:
             for cls in (multi or "").split():
                 virtualfn = self.realfn2virtual(fn, cls)
-                logger.debug(2, "Cache: Removing %s from cache", virtualfn)
-                del self.clean[virtualfn]
-            logger.debug(2, "Cache: removing %s from cache", fn)
-            del self.clean[fn]
+                if virtualfn in self.clean:
+                    logger.debug(2, "Cache: Removing %s from cache", virtualfn)
+                    del self.clean[virtualfn]
+            if fn in self.clean:
+                logger.debug(2, "Cache: Marking %s as not clean", fn)
+                del self.clean[fn]
             return False
 
         return True
@@ -311,10 +313,11 @@ class Cache:
         Remove a fn from the cache
         Called from the parser in error cases
         """
-        logger.debug(1, "Removing %s from cache", fn)
         if fn in self.depends_cache:
+            logger.debug(1, "Removing %s from cache", fn)
             del self.depends_cache[fn]
         if fn in self.clean:
+            logger.debug(1, "Marking %s as unclean", fn)
             del self.clean[fn]
 
     def sync(self):