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 22:18:40 +0000 |
commit | bee33a9623c763eb11e8009ffa76869861a9d4a7 (patch) | |
tree | ad9820cb9c90a1ecff13290ffbccaa5a4580230f /lib | |
parent | 94709a0904ca3f02f5067aacf244f300a1d16627 (diff) | |
download | bitbake-bee33a9623c763eb11e8009ffa76869861a9d4a7.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
(From Poky rev: ec6e4793dc79c61b780b74571db4cd66c1c04251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bb/build.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/bb/build.py b/lib/bb/build.py index 445bd6dee..0f7059c98 100644 --- a/lib/bb/build.py +++ b/lib/bb/build.py @@ -311,7 +311,6 @@ def exec_task(fn, task, d): def stamp_internal(task, d, file_name): """ Internal stamp helper function - Removes any stamp for the given task Makes sure the stamp directory exists Returns the stamp path+filename @@ -327,11 +326,9 @@ def stamp_internal(task, d, file_name): return stamp = "%s.%s" % (stamp, task) + bb.utils.mkdirhier(os.path.dirname(stamp)) - # Remove the file and recreate to force timestamp - # change on broken NFS filesystems - if os.access(stamp, os.F_OK): - os.remove(stamp) + return stamp def make_stamp(task, d, file_name = None): @@ -340,6 +337,10 @@ def make_stamp(task, d, file_name = None): (d can be a data dict or dataCache) """ stamp = stamp_internal(task, d, file_name) + # Remove the file and recreate to force timestamp + # change on broken NFS filesystems + if os.access(stamp, os.F_OK): + os.remove(stamp) if stamp: f = open(stamp, "w") f.close() @@ -350,6 +351,11 @@ def del_stamp(task, d, file_name = None): (d can be a data dict or dataCache) """ stamp_internal(task, d, file_name) + if os.access(stamp, os.F_OK): + os.remove(stamp) + +def stampfile(taskname, d): + return stamp_internal(taskname, d, None) def add_tasks(tasklist, d): task_deps = data.getVar('_task_deps', d) |