All of lore.kernel.org
 help / color / mirror / Atom feed
* [bitbake-devel][PATCH] bitbake: cache: Fix error when cache is rebuilt
@ 2020-06-08 21:03 Joshua Watt
  0 siblings, 0 replies; only message in thread
From: Joshua Watt @ 2020-06-08 21:03 UTC (permalink / raw)
  To: bitbake-devel; +Cc: richard.purdie, Joshua Watt

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.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
 bitbake/lib/bb/cache.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py
index df78d5b701..be5ea6a8bd 100644
--- a/bitbake/lib/bb/cache.py
+++ b/bitbake/lib/bb/cache.py
@@ -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
-- 
2.26.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-06-08 21:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-08 21:03 [bitbake-devel][PATCH] bitbake: cache: Fix error when cache is rebuilt Joshua Watt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.