summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/parse/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/parse/__init__.py')
-rw-r--r--bitbake/lib/bb/parse/__init__.py9
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' ]
27handlers = [] 27handlers = []
28 28
29import bb, os
30
29class ParseError(Exception): 31class 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 = {}
36def cached_mtime(f): 38def 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
43def update_mtime(f):
44 __mtime_cache[f] = os.stat(f)[8]
45
42def mark_dependency(d, f): 46def 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()