diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2015-08-17 12:12:28 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-08-18 12:12:07 +0100 |
commit | fe105b9042bdac4afd9f38fcf92bfdc2c04ec23f (patch) | |
tree | 2f44335c397b17412ba06a167947113950adb3f5 /lib | |
parent | 1ef38549cae5639f2c8bcc2b270c5c82a5e29e3c (diff) | |
download | openembedded-core-contrib-fe105b9042bdac4afd9f38fcf92bfdc2c04ec23f.tar.gz |
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.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bb/parse/__init__.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/bb/parse/__init__.py b/lib/bb/parse/__init__.py index 1becaa4f02..67ec71f866 100644 --- a/lib/bb/parse/__init__.py +++ b/lib/bb/parse/__init__.py @@ -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): |