summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/cache.py
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-03-24 16:56:12 -0700
committerRichard Purdie <rpurdie@linux.intel.com>2010-07-02 15:41:32 +0100
commit7acc132cac873e60005516272473a55a8160b9c4 (patch)
tree2e4122862ffd856803160b6089fcb979d3efd630 /bitbake/lib/bb/cache.py
parentbbf83fd988ca3cf9dae7d2b542a11a7c942b1702 (diff)
downloadpoky-7acc132cac873e60005516272473a55a8160b9c4.tar.gz
Formatting cleanups
(Bitbake rev: 2caf134b43a44dad30af4fbe33033b3c58deee57) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/cache.py')
-rw-r--r--bitbake/lib/bb/cache.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py
index 106621911b..300acc5fc6 100644
--- a/bitbake/lib/bb/cache.py
+++ b/bitbake/lib/bb/cache.py
@@ -73,7 +73,7 @@ class Cache:
73 # cache there isn't even any point in loading it... 73 # cache there isn't even any point in loading it...
74 newest_mtime = 0 74 newest_mtime = 0
75 deps = bb.data.getVar("__depends", data, True) 75 deps = bb.data.getVar("__depends", data, True)
76 for f,old_mtime in deps: 76 for f, old_mtime in deps:
77 if old_mtime > newest_mtime: 77 if old_mtime > newest_mtime:
78 newest_mtime = old_mtime 78 newest_mtime = old_mtime
79 79
@@ -102,10 +102,10 @@ class Cache:
102 """ 102 """
103 Gets the value of a variable 103 Gets the value of a variable
104 (similar to getVar in the data class) 104 (similar to getVar in the data class)
105 105
106 There are two scenarios: 106 There are two scenarios:
107 1. We have cached data - serve from depends_cache[fn] 107 1. We have cached data - serve from depends_cache[fn]
108 2. We're learning what data to cache - serve from data 108 2. We're learning what data to cache - serve from data
109 backend but add a copy of the data to the cache. 109 backend but add a copy of the data to the cache.
110 """ 110 """
111 if fn in self.clean: 111 if fn in self.clean:
@@ -134,7 +134,7 @@ 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 # If we're a virtual class we need to make sure all our depends are appended 137 # If we're a virtual class we need to make sure all our depends are appended
138 # to the depends of fn. 138 # to the depends of fn.
139 depends = self.getVar("__depends", virtualfn, True) or [] 139 depends = self.getVar("__depends", virtualfn, True) or []
140 self.depends_cache.setdefault(fn, {}) 140 self.depends_cache.setdefault(fn, {})
@@ -259,7 +259,7 @@ class Cache:
259 self.remove(fn) 259 self.remove(fn)
260 return False 260 return False
261 261
262 mtime = bb.parse.cached_mtime_noerror(fn) 262 mtime = bb.parse.cached_mtime_noerror(fn)
263 263
264 # Check file still exists 264 # Check file still exists
265 if mtime == 0: 265 if mtime == 0:
@@ -276,7 +276,7 @@ class Cache:
276 # Check dependencies are still valid 276 # Check dependencies are still valid
277 depends = self.getVar("__depends", fn, True) 277 depends = self.getVar("__depends", fn, True)
278 if depends: 278 if depends:
279 for f,old_mtime in depends: 279 for f, old_mtime in depends:
280 fmtime = bb.parse.cached_mtime_noerror(f) 280 fmtime = bb.parse.cached_mtime_noerror(f)
281 # Check if file still exists 281 # Check if file still exists
282 if old_mtime != 0 and fmtime == 0: 282 if old_mtime != 0 and fmtime == 0:
@@ -346,7 +346,7 @@ class Cache:
346 346
347 def handle_data(self, file_name, cacheData): 347 def handle_data(self, file_name, cacheData):
348 """ 348 """
349 Save data we need into the cache 349 Save data we need into the cache
350 """ 350 """
351 351
352 pn = self.getVar('PN', file_name, True) 352 pn = self.getVar('PN', file_name, True)
@@ -372,7 +372,7 @@ class Cache:
372 372
373 # build FileName to PackageName lookup table 373 # build FileName to PackageName lookup table
374 cacheData.pkg_fn[file_name] = pn 374 cacheData.pkg_fn[file_name] = pn
375 cacheData.pkg_pepvpr[file_name] = (pe,pv,pr) 375 cacheData.pkg_pepvpr[file_name] = (pe, pv, pr)
376 cacheData.pkg_dp[file_name] = dp 376 cacheData.pkg_dp[file_name] = dp
377 377
378 provides = [pn] 378 provides = [pn]
@@ -401,13 +401,13 @@ class Cache:
401 if not dep in cacheData.all_depends: 401 if not dep in cacheData.all_depends:
402 cacheData.all_depends.append(dep) 402 cacheData.all_depends.append(dep)
403 403
404 # Build reverse hash for PACKAGES, so runtime dependencies 404 # Build reverse hash for PACKAGES, so runtime dependencies
405 # can be be resolved (RDEPENDS, RRECOMMENDS etc.) 405 # can be be resolved (RDEPENDS, RRECOMMENDS etc.)
406 for package in packages: 406 for package in packages:
407 if not package in cacheData.packages: 407 if not package in cacheData.packages:
408 cacheData.packages[package] = [] 408 cacheData.packages[package] = []
409 cacheData.packages[package].append(file_name) 409 cacheData.packages[package].append(file_name)
410 rprovides += (self.getVar("RPROVIDES_%s" % package, file_name, 1) or "").split() 410 rprovides += (self.getVar("RPROVIDES_%s" % package, file_name, 1) or "").split()
411 411
412 for package in packages_dynamic: 412 for package in packages_dynamic:
413 if not package in cacheData.packages_dynamic: 413 if not package in cacheData.packages_dynamic:
@@ -472,12 +472,12 @@ class Cache:
472 472
473def init(cooker): 473def init(cooker):
474 """ 474 """
475 The Objective: Cache the minimum amount of data possible yet get to the 475 The Objective: Cache the minimum amount of data possible yet get to the
476 stage of building packages (i.e. tryBuild) without reparsing any .bb files. 476 stage of building packages (i.e. tryBuild) without reparsing any .bb files.
477 477
478 To do this, we intercept getVar calls and only cache the variables we see 478 To do this, we intercept getVar calls and only cache the variables we see
479 being accessed. We rely on the cache getVar calls being made for all 479 being accessed. We rely on the cache getVar calls being made for all
480 variables bitbake might need to use to reach this stage. For each cached 480 variables bitbake might need to use to reach this stage. For each cached
481 file we need to track: 481 file we need to track:
482 482
483 * Its mtime 483 * Its mtime