diff options
Diffstat (limited to 'bitbake/lib/bb/parse/__init__.py')
-rw-r--r-- | bitbake/lib/bb/parse/__init__.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/bitbake/lib/bb/parse/__init__.py b/bitbake/lib/bb/parse/__init__.py index b8839c09fd..cb27416061 100644 --- a/bitbake/lib/bb/parse/__init__.py +++ b/bitbake/lib/bb/parse/__init__.py | |||
@@ -26,6 +26,8 @@ __all__ = [ 'ParseError', 'SkipPackage', 'cached_mtime', 'mark_dependency', | |||
26 | 'supports', 'handle', 'init' ] | 26 | 'supports', 'handle', 'init' ] |
27 | handlers = [] | 27 | handlers = [] |
28 | 28 | ||
29 | import bb, os | ||
30 | |||
29 | class ParseError(Exception): | 31 | class ParseError(Exception): |
30 | """Exception raised when parsing fails""" | 32 | """Exception raised when parsing fails""" |
31 | 33 | ||
@@ -34,13 +36,14 @@ class SkipPackage(Exception): | |||
34 | 36 | ||
35 | __mtime_cache = {} | 37 | __mtime_cache = {} |
36 | def cached_mtime(f): | 38 | def cached_mtime(f): |
37 | import os | ||
38 | if not __mtime_cache.has_key(f): | 39 | if not __mtime_cache.has_key(f): |
39 | __mtime_cache[f] = os.stat(f)[8] | 40 | update_mtime(f) |
40 | return __mtime_cache[f] | 41 | return __mtime_cache[f] |
41 | 42 | ||
43 | def update_mtime(f): | ||
44 | __mtime_cache[f] = os.stat(f)[8] | ||
45 | |||
42 | def mark_dependency(d, f): | 46 | def mark_dependency(d, f): |
43 | import bb, os | ||
44 | if f.startswith('./'): | 47 | if f.startswith('./'): |
45 | f = "%s/%s" % (os.getcwd(), f[2:]) | 48 | f = "%s/%s" % (os.getcwd(), f[2:]) |
46 | deps = (bb.data.getVar('__depends', d) or "").split() | 49 | deps = (bb.data.getVar('__depends', d) or "").split() |