bitbake: lib/bb/parse: properly handle OSError when updating mtime cache
If a file no longer exists, drop it from the cache silently instead of generating a traceback. This was visible in some cases when a recipe was deleted when bitbake was resident in memory. (Bitbake rev: fe105b9042bdac4afd9f38fcf92bfdc2c04ec23f) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
97067755b9
commit
9b05ef581c
|
@ -71,7 +71,12 @@ def cached_mtime_noerror(f):
|
|||
return __mtime_cache[f]
|
||||
|
||||
def update_mtime(f):
|
||||
__mtime_cache[f] = os.stat(f)[stat.ST_MTIME]
|
||||
try:
|
||||
__mtime_cache[f] = os.stat(f)[stat.ST_MTIME]
|
||||
except OSError:
|
||||
if f in __mtime_cache:
|
||||
del __mtime_cache[f]
|
||||
return 0
|
||||
return __mtime_cache[f]
|
||||
|
||||
def update_cache(f):
|
||||
|
|
Loading…
Reference in New Issue