diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-01-06 19:43:41 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-01-06 19:43:56 +0000 |
| commit | ec6e4793dc79c61b780b74571db4cd66c1c04251 (patch) | |
| tree | 116fa2753ef2ba81facd490eef6fab8bade1b898 /bitbake/lib/bb/build.py | |
| parent | 4a10a5b438f49577fb29f4e277e2300cdce10ab8 (diff) | |
| download | poky-ec6e4793dc79c61b780b74571db4cd66c1c04251.tar.gz | |
bitbake build.py: Stamp handling improvements
* Move stamp file deletion out of the internal stamp helper function
* Add a new function to return the path to a stamp for a given task
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/build.py')
| -rw-r--r-- | bitbake/lib/bb/build.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py index 967aa21a70..3fc01486ca 100644 --- a/bitbake/lib/bb/build.py +++ b/bitbake/lib/bb/build.py | |||
| @@ -376,7 +376,6 @@ def exec_task(fn, task, d): | |||
| 376 | def stamp_internal(task, d, file_name): | 376 | def stamp_internal(task, d, file_name): |
| 377 | """ | 377 | """ |
| 378 | Internal stamp helper function | 378 | Internal stamp helper function |
| 379 | Removes any stamp for the given task | ||
| 380 | Makes sure the stamp directory exists | 379 | Makes sure the stamp directory exists |
| 381 | Returns the stamp path+filename | 380 | Returns the stamp path+filename |
| 382 | 381 | ||
| @@ -392,11 +391,9 @@ def stamp_internal(task, d, file_name): | |||
| 392 | return | 391 | return |
| 393 | 392 | ||
| 394 | stamp = "%s.%s" % (stamp, task) | 393 | stamp = "%s.%s" % (stamp, task) |
| 394 | |||
| 395 | bb.utils.mkdirhier(os.path.dirname(stamp)) | 395 | bb.utils.mkdirhier(os.path.dirname(stamp)) |
| 396 | # Remove the file and recreate to force timestamp | 396 | |
| 397 | # change on broken NFS filesystems | ||
| 398 | if os.access(stamp, os.F_OK): | ||
| 399 | os.remove(stamp) | ||
| 400 | return stamp | 397 | return stamp |
| 401 | 398 | ||
| 402 | def make_stamp(task, d, file_name = None): | 399 | def make_stamp(task, d, file_name = None): |
| @@ -405,6 +402,10 @@ def make_stamp(task, d, file_name = None): | |||
| 405 | (d can be a data dict or dataCache) | 402 | (d can be a data dict or dataCache) |
| 406 | """ | 403 | """ |
| 407 | stamp = stamp_internal(task, d, file_name) | 404 | stamp = stamp_internal(task, d, file_name) |
| 405 | # Remove the file and recreate to force timestamp | ||
| 406 | # change on broken NFS filesystems | ||
| 407 | if os.access(stamp, os.F_OK): | ||
| 408 | os.remove(stamp) | ||
| 408 | if stamp: | 409 | if stamp: |
| 409 | f = open(stamp, "w") | 410 | f = open(stamp, "w") |
| 410 | f.close() | 411 | f.close() |
| @@ -415,6 +416,11 @@ def del_stamp(task, d, file_name = None): | |||
| 415 | (d can be a data dict or dataCache) | 416 | (d can be a data dict or dataCache) |
| 416 | """ | 417 | """ |
| 417 | stamp_internal(task, d, file_name) | 418 | stamp_internal(task, d, file_name) |
| 419 | if os.access(stamp, os.F_OK): | ||
| 420 | os.remove(stamp) | ||
| 421 | |||
| 422 | def stampfile(taskname, d): | ||
| 423 | return stamp_internal(taskname, d, None) | ||
| 418 | 424 | ||
| 419 | def add_tasks(tasklist, d): | 425 | def add_tasks(tasklist, d): |
| 420 | task_deps = data.getVar('_task_deps', d) | 426 | task_deps = data.getVar('_task_deps', d) |
