diff options
Diffstat (limited to 'bitbake/lib/bb/parse/__init__.py')
-rw-r--r-- | bitbake/lib/bb/parse/__init__.py | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/bitbake/lib/bb/parse/__init__.py b/bitbake/lib/bb/parse/__init__.py index c01807ba87..7ffdaa6fd7 100644 --- a/bitbake/lib/bb/parse/__init__.py +++ b/bitbake/lib/bb/parse/__init__.py | |||
@@ -49,20 +49,32 @@ class SkipPackage(SkipRecipe): | |||
49 | __mtime_cache = {} | 49 | __mtime_cache = {} |
50 | def cached_mtime(f): | 50 | def cached_mtime(f): |
51 | if f not in __mtime_cache: | 51 | if f not in __mtime_cache: |
52 | __mtime_cache[f] = os.stat(f)[stat.ST_MTIME] | 52 | res = os.stat(f) |
53 | __mtime_cache[f] = (res.st_mtime_ns, res.st_size, res.st_ino) | ||
53 | return __mtime_cache[f] | 54 | return __mtime_cache[f] |
54 | 55 | ||
55 | def cached_mtime_noerror(f): | 56 | def cached_mtime_noerror(f): |
56 | if f not in __mtime_cache: | 57 | if f not in __mtime_cache: |
57 | try: | 58 | try: |
58 | __mtime_cache[f] = os.stat(f)[stat.ST_MTIME] | 59 | res = os.stat(f) |
60 | __mtime_cache[f] = (res.st_mtime_ns, res.st_size, res.st_ino) | ||
59 | except OSError: | 61 | except OSError: |
60 | return 0 | 62 | return 0 |
61 | return __mtime_cache[f] | 63 | return __mtime_cache[f] |
62 | 64 | ||
65 | def check_mtime(f, mtime): | ||
66 | try: | ||
67 | res = os.stat(f) | ||
68 | current_mtime = (res.st_mtime_ns, res.st_size, res.st_ino) | ||
69 | __mtime_cache[f] = current_mtime | ||
70 | except OSError: | ||
71 | current_mtime = 0 | ||
72 | return current_mtime == mtime | ||
73 | |||
63 | def update_mtime(f): | 74 | def update_mtime(f): |
64 | try: | 75 | try: |
65 | __mtime_cache[f] = os.stat(f)[stat.ST_MTIME] | 76 | res = os.stat(f) |
77 | __mtime_cache[f] = (res.st_mtime_ns, res.st_size, res.st_ino) | ||
66 | except OSError: | 78 | except OSError: |
67 | if f in __mtime_cache: | 79 | if f in __mtime_cache: |
68 | del __mtime_cache[f] | 80 | del __mtime_cache[f] |
@@ -99,12 +111,12 @@ def supports(fn, data): | |||
99 | return 1 | 111 | return 1 |
100 | return 0 | 112 | return 0 |
101 | 113 | ||
102 | def handle(fn, data, include = 0): | 114 | def handle(fn, data, include=0, baseconfig=False): |
103 | """Call the handler that is appropriate for this file""" | 115 | """Call the handler that is appropriate for this file""" |
104 | for h in handlers: | 116 | for h in handlers: |
105 | if h['supports'](fn, data): | 117 | if h['supports'](fn, data): |
106 | with data.inchistory.include(fn): | 118 | with data.inchistory.include(fn): |
107 | return h['handle'](fn, data, include) | 119 | return h['handle'](fn, data, include, baseconfig) |
108 | raise ParseError("not a BitBake file", fn) | 120 | raise ParseError("not a BitBake file", fn) |
109 | 121 | ||
110 | def init(fn, data): | 122 | def init(fn, data): |
@@ -113,6 +125,8 @@ def init(fn, data): | |||
113 | return h['init'](data) | 125 | return h['init'](data) |
114 | 126 | ||
115 | def init_parser(d): | 127 | def init_parser(d): |
128 | if hasattr(bb.parse, "siggen"): | ||
129 | bb.parse.siggen.exit() | ||
116 | bb.parse.siggen = bb.siggen.init(d) | 130 | bb.parse.siggen = bb.siggen.init(d) |
117 | 131 | ||
118 | def resolve_file(fn, d): | 132 | def resolve_file(fn, d): |