]> code.ossystems Code Review - openembedded-core.git/commitdiff
bitbake build.py: Stamp handling improvements
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 6 Jan 2011 19:43:41 +0000 (19:43 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 6 Jan 2011 19:43:56 +0000 (19:43 +0000)
* 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>
bitbake/lib/bb/build.py

index 967aa21a70af4ae64efb00d7cdf9fa497274d67b..3fc01486ca90b17f1744eb6a2ffdc899cb8dd4f6 100644 (file)
@@ -376,7 +376,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
 
@@ -392,11 +391,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):
@@ -405,6 +402,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()
@@ -415,6 +416,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)