summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-01-20 18:39:00 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2010-01-20 18:39:00 +0000
commit1bfd6edef9db9c9175058ae801d1b601e4f15263 (patch)
tree899bc6771c9def07be628ba735c6bad158f7363e
parentd6c7a44b94aa0f871d3ad1a2097a4a8d773eabf5 (diff)
downloadpoky-1bfd6edef9db9c9175058ae801d1b601e4f15263.tar.gz
bitbake-dev: Sync with bitbake upstream
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
-rw-r--r--bitbake-dev/lib/bb/cache.py89
-rw-r--r--bitbake-dev/lib/bb/cooker.py21
-rw-r--r--bitbake-dev/lib/bb/event.py5
-rw-r--r--bitbake-dev/lib/bb/parse/parse_py/BBHandler.py28
-rw-r--r--bitbake-dev/lib/bb/ui/knotty.py4
5 files changed, 79 insertions, 68 deletions
diff --git a/bitbake-dev/lib/bb/cache.py b/bitbake-dev/lib/bb/cache.py
index d30d57d33b..2f1b8fa601 100644
--- a/bitbake-dev/lib/bb/cache.py
+++ b/bitbake-dev/lib/bb/cache.py
@@ -134,7 +134,18 @@ class Cache:
134 self.data = data 134 self.data = data
135 135
136 # Make sure __depends makes the depends_cache 136 # Make sure __depends makes the depends_cache
137 self.getVar("__depends", virtualfn, True) 137 # If we're a virtual class we need to make sure all our depends are appended
138 # to the depends of fn.
139 depends = self.getVar("__depends", virtualfn, True) or []
140 if "__depends" not in self.depends_cache[fn] or not self.depends_cache[fn]["__depends"]:
141 self.depends_cache[fn]["__depends"] = depends
142 for dep in depends:
143 if dep not in self.depends_cache[fn]["__depends"]:
144 self.depends_cache[fn]["__depends"].append(dep)
145
146 # Make sure BBCLASSEXTEND always makes the cache too
147 self.getVar('BBCLASSEXTEND', virtualfn, True)
148
138 self.depends_cache[virtualfn]["CACHETIMESTAMP"] = bb.parse.cached_mtime(fn) 149 self.depends_cache[virtualfn]["CACHETIMESTAMP"] = bb.parse.cached_mtime(fn)
139 150
140 def virtualfn2realfn(self, virtualfn): 151 def virtualfn2realfn(self, virtualfn):
@@ -170,11 +181,8 @@ class Cache:
170 181
171 bb.msg.debug(1, bb.msg.domain.Cache, "Parsing %s (full)" % fn) 182 bb.msg.debug(1, bb.msg.domain.Cache, "Parsing %s (full)" % fn)
172 183
173 bb_data, skipped = self.load_bbfile(fn, cfgData) 184 bb_data = self.load_bbfile(fn, cfgData)
174 if isinstance(bb_data, dict): 185 return bb_data[cls]
175 return bb_data[cls]
176
177 return bb_data
178 186
179 def loadData(self, fn, cfgData, cacheData): 187 def loadData(self, fn, cfgData, cacheData):
180 """ 188 """
@@ -184,42 +192,39 @@ class Cache:
184 to record the variables accessed. 192 to record the variables accessed.
185 Return the cache status and whether the file was skipped when parsed 193 Return the cache status and whether the file was skipped when parsed
186 """ 194 """
195 skipped = 0
196 virtuals = 0
197
187 if fn not in self.checked: 198 if fn not in self.checked:
188 self.cacheValidUpdate(fn) 199 self.cacheValidUpdate(fn)
200
189 if self.cacheValid(fn): 201 if self.cacheValid(fn):
190 if "SKIPPED" in self.depends_cache[fn]:
191 return True, True
192 self.handle_data(fn, cacheData)
193 multi = self.getVar('BBCLASSEXTEND', fn, True) 202 multi = self.getVar('BBCLASSEXTEND', fn, True)
194 if multi: 203 for cls in (multi or "").split() + [""]:
195 for cls in multi.split(): 204 virtualfn = self.realfn2virtual(fn, cls)
196 virtualfn = self.realfn2virtual(fn, cls) 205 if self.depends_cache[virtualfn]["__SKIPPED"]:
197 # Pretend we're clean so getVar works 206 skipped += 1
198 self.clean[virtualfn] = "" 207 bb.msg.debug(1, bb.msg.domain.Cache, "Skipping %s" % virtualfn)
199 self.handle_data(virtualfn, cacheData) 208 continue
200 return True, False 209 self.handle_data(virtualfn, cacheData)
210 virtuals += 1
211 return True, skipped, virtuals
201 212
202 bb.msg.debug(1, bb.msg.domain.Cache, "Parsing %s" % fn) 213 bb.msg.debug(1, bb.msg.domain.Cache, "Parsing %s" % fn)
203 214
204 bb_data, skipped = self.load_bbfile(fn, cfgData) 215 bb_data = self.load_bbfile(fn, cfgData)
205
206 if skipped:
207 if isinstance(bb_data, dict):
208 self.setData(fn, fn, bb_data[""])
209 else:
210 self.setData(fn, fn, bb_data)
211 return False, skipped
212 216
213 if isinstance(bb_data, dict): 217 for data in bb_data:
214 for data in bb_data: 218 virtualfn = self.realfn2virtual(fn, data)
215 virtualfn = self.realfn2virtual(fn, data) 219 self.setData(virtualfn, fn, bb_data[data])
216 self.setData(virtualfn, fn, bb_data[data]) 220 if self.getVar("__SKIPPED", virtualfn, True):
221 skipped += 1
222 bb.msg.debug(1, bb.msg.domain.Cache, "Skipping %s" % virtualfn)
223 else:
217 self.handle_data(virtualfn, cacheData) 224 self.handle_data(virtualfn, cacheData)
218 return False, skipped 225 virtuals += 1
226 return False, skipped, virtuals
219 227
220 self.setData(fn, fn, bb_data)
221 self.handle_data(fn, cacheData)
222 return False, skipped
223 228
224 def cacheValid(self, fn): 229 def cacheValid(self, fn):
225 """ 230 """
@@ -286,16 +291,13 @@ class Cache:
286 if not fn in self.clean: 291 if not fn in self.clean:
287 self.clean[fn] = "" 292 self.clean[fn] = ""
288 293
289 return True 294 # Mark extended class data as clean too
295 multi = self.getVar('BBCLASSEXTEND', fn, True)
296 for cls in (multi or "").split():
297 virtualfn = self.realfn2virtual(fn, cls)
298 self.clean[virtualfn] = ""
290 299
291 def skip(self, fn): 300 return True
292 """
293 Mark a fn as skipped
294 Called from the parser
295 """
296 if not fn in self.depends_cache:
297 self.depends_cache[fn] = {}
298 self.depends_cache[fn]["SKIPPED"] = "1"
299 301
300 def remove(self, fn): 302 def remove(self, fn):
301 """ 303 """
@@ -462,10 +464,7 @@ class Cache:
462 try: 464 try:
463 bb_data = parse.handle(bbfile, bb_data) # read .bb data 465 bb_data = parse.handle(bbfile, bb_data) # read .bb data
464 os.chdir(oldpath) 466 os.chdir(oldpath)
465 return bb_data, False 467 return bb_data
466 except bb.parse.SkipPackage:
467 os.chdir(oldpath)
468 return bb_data, True
469 except: 468 except:
470 os.chdir(oldpath) 469 os.chdir(oldpath)
471 raise 470 raise
diff --git a/bitbake-dev/lib/bb/cooker.py b/bitbake-dev/lib/bb/cooker.py
index 25131b7406..8036d7e9d5 100644
--- a/bitbake-dev/lib/bb/cooker.py
+++ b/bitbake-dev/lib/bb/cooker.py
@@ -923,11 +923,13 @@ class CookerParser:
923 # Accounting statistics 923 # Accounting statistics
924 self.parsed = 0 924 self.parsed = 0
925 self.cached = 0 925 self.cached = 0
926 self.skipped = 0
927 self.error = 0 926 self.error = 0
928 self.masked = masked 927 self.masked = masked
929 self.total = len(filelist) 928 self.total = len(filelist)
930 929
930 self.skipped = 0
931 self.virtuals = 0
932
931 # Pointer to the next file to parse 933 # Pointer to the next file to parse
932 self.pointer = 0 934 self.pointer = 0
933 935
@@ -937,13 +939,14 @@ class CookerParser:
937 cooker = self.cooker 939 cooker = self.cooker
938 940
939 try: 941 try:
940 fromCache, skip = cooker.bb_cache.loadData(f, cooker.configuration.data, cooker.status) 942 fromCache, skipped, virtuals = cooker.bb_cache.loadData(f, cooker.configuration.data, cooker.status)
941 if skip: 943 if fromCache:
942 self.skipped += 1 944 self.cached += 1
943 bb.msg.debug(2, bb.msg.domain.Collection, "skipping %s" % f) 945 else:
944 cooker.bb_cache.skip(f) 946 self.parsed += 1
945 elif fromCache: self.cached += 1 947
946 else: self.parsed += 1 948 self.skipped += skipped
949 self.virtuals += virtuals
947 950
948 except IOError, e: 951 except IOError, e:
949 self.error += 1 952 self.error += 1
@@ -962,7 +965,7 @@ class CookerParser:
962 cooker.bb_cache.remove(f) 965 cooker.bb_cache.remove(f)
963 raise 966 raise
964 finally: 967 finally:
965 bb.event.fire(bb.event.ParseProgress(self.cached, self.parsed, self.skipped, self.masked, self.error, self.total), cooker.configuration.event_data) 968 bb.event.fire(bb.event.ParseProgress(self.cached, self.parsed, self.skipped, self.masked, self.virtuals, self.error, self.total), cooker.configuration.event_data)
966 969
967 self.pointer += 1 970 self.pointer += 1
968 971
diff --git a/bitbake-dev/lib/bb/event.py b/bitbake-dev/lib/bb/event.py
index 3062dc51be..7251d78715 100644
--- a/bitbake-dev/lib/bb/event.py
+++ b/bitbake-dev/lib/bb/event.py
@@ -253,14 +253,15 @@ class ParseProgress(Event):
253 Parsing Progress Event 253 Parsing Progress Event
254 """ 254 """
255 255
256 def __init__(self, cached, parsed, skipped, masked, errors, total): 256 def __init__(self, cached, parsed, skipped, masked, virtuals, errors, total):
257 Event.__init__(self) 257 Event.__init__(self)
258 self.cached = cached 258 self.cached = cached
259 self.parsed = parsed 259 self.parsed = parsed
260 self.skipped = skipped 260 self.skipped = skipped
261 self.virtuals = virtuals
261 self.masked = masked 262 self.masked = masked
262 self.errors = errors 263 self.errors = errors
263 self.sofar = cached + parsed + skipped 264 self.sofar = cached + parsed
264 self.total = total 265 self.total = total
265 266
266class DepTreeGenerated(Event): 267class DepTreeGenerated(Event):
diff --git a/bitbake-dev/lib/bb/parse/parse_py/BBHandler.py b/bitbake-dev/lib/bb/parse/parse_py/BBHandler.py
index 9b353634ed..86fa18ebd2 100644
--- a/bitbake-dev/lib/bb/parse/parse_py/BBHandler.py
+++ b/bitbake-dev/lib/bb/parse/parse_py/BBHandler.py
@@ -185,18 +185,26 @@ def handle(fn, d, include = 0):
185 multi = data.getVar('BBCLASSEXTEND', d, 1) 185 multi = data.getVar('BBCLASSEXTEND', d, 1)
186 if multi: 186 if multi:
187 based = bb.data.createCopy(d) 187 based = bb.data.createCopy(d)
188 else:
189 based = d
190 try:
188 finalise(fn, based) 191 finalise(fn, based)
189 darray = {"": based} 192 except bb.parse.SkipPackage:
190 for cls in multi.split(): 193 bb.data.setVar("__SKIPPED", True, based)
191 pn = data.getVar('PN', d, True) 194 darray = {"": based}
192 based = bb.data.createCopy(d) 195
193 data.setVar('PN', pn + '-' + cls, based) 196 for cls in (multi or "").split():
194 inherit([cls], based) 197 pn = data.getVar('PN', d, True)
198 based = bb.data.createCopy(d)
199 data.setVar('PN', pn + '-' + cls, based)
200 inherit([cls], based)
201 try:
195 finalise(fn, based) 202 finalise(fn, based)
196 darray[cls] = based 203 except bb.parse.SkipPackage:
197 return darray 204 bb.data.setVar("__SKIPPED", True, based)
198 else: 205 darray[cls] = based
199 finalise(fn, d) 206 return darray
207
200 bbpath.pop(0) 208 bbpath.pop(0)
201 if oldfile: 209 if oldfile:
202 bb.data.setVar("FILE", oldfile, d) 210 bb.data.setVar("FILE", oldfile, d)
diff --git a/bitbake-dev/lib/bb/ui/knotty.py b/bitbake-dev/lib/bb/ui/knotty.py
index 6baed836a1..c69fd6ca64 100644
--- a/bitbake-dev/lib/bb/ui/knotty.py
+++ b/bitbake-dev/lib/bb/ui/knotty.py
@@ -114,8 +114,8 @@ def init(server, eventHandler):
114 sys.stdout.write("done.") 114 sys.stdout.write("done.")
115 sys.stdout.flush() 115 sys.stdout.flush()
116 if x == y: 116 if x == y:
117 print("\nParsing finished. %d cached, %d parsed, %d skipped, %d masked, %d errors." 117 print("\nParsing of %d .bb files complete (%d cached, %d parsed). %d targets, %d skipped, %d masked, %d errors."
118 % ( event.cached, event.parsed, event.skipped, event.masked, event.errors)) 118 % ( event.total, event.cached, event.parsed, event.virtuals, event.skipped, event.masked, event.errors))
119 continue 119 continue
120 120
121 if isinstance(event, bb.command.CookerCommandCompleted): 121 if isinstance(event, bb.command.CookerCommandCompleted):