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-19 18:05:48 +0100 |
commit | 9b05ef581c73a06894b2970d97e897c59f9fc5b9 (patch) | |
tree | da59927304be2af6e3d8897763eff03c3caaed59 /bitbake/lib/bb/parse | |
parent | 97067755b936547f1bf87c1c0c64eccc320f48ca (diff) | |
download | poky-9b05ef581c73a06894b2970d97e897c59f9fc5b9.tar.gz |
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>
Diffstat (limited to 'bitbake/lib/bb/parse')
-rw-r--r-- | bitbake/lib/bb/parse/__init__.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/bitbake/lib/bb/parse/__init__.py b/bitbake/lib/bb/parse/__init__.py index 1becaa4f02..67ec71f866 100644 --- a/bitbake/lib/bb/parse/__init__.py +++ b/bitbake/lib/bb/parse/__init__.py | |||
@@ -71,7 +71,12 @@ def cached_mtime_noerror(f): | |||
71 | return __mtime_cache[f] | 71 | return __mtime_cache[f] |
72 | 72 | ||
73 | def update_mtime(f): | 73 | def update_mtime(f): |
74 | __mtime_cache[f] = os.stat(f)[stat.ST_MTIME] | 74 | try: |
75 | __mtime_cache[f] = os.stat(f)[stat.ST_MTIME] | ||
76 | except OSError: | ||
77 | if f in __mtime_cache: | ||
78 | del __mtime_cache[f] | ||
79 | return 0 | ||
75 | return __mtime_cache[f] | 80 | return __mtime_cache[f] |
76 | 81 | ||
77 | def update_cache(f): | 82 | def update_cache(f): |