Skip to contentSkip to conversation

bitbake: cache: Fix error when cache is rebuilt

PATCH New Joshua Watt 1 participant 1 message Jun 8, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bitbake: cache: Fix error when cache is rebuilt

It is expected that load_cachfile() returns an integer indicating how many entries were loaded from the cache. In the event the cache needs to be rebuilt, 0 must be returned to prevent python from attempting to add an None and an integer together.

---
 bitbake/lib/bb/cache.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
bitbake/lib/bb/cache.py +3 -3
index df78d5b701..be5ea6a8bd 100644
@@ -464,14 +464,14 @@ class Cache(NoCache):
                     bitbake_ver = pickled.load()
                 except Exception:
                     self.logger.info('Invalid cache, rebuilding...')
-                    return
+                    return 0
 
                 if cache_ver != __cache_version__:
                     self.logger.info('Cache version mismatch, rebuilding...')
-                    return
+                    return 0
                 elif bitbake_ver != bb.__version__:
                     self.logger.info('Bitbake version mismatch, rebuilding...')
-                    return
+                    return 0
 
                 # Load the rest of the cache file
                 current_progress = 0
Signature · 1 line
2.26.2