]> code.ossystems Code Review - openembedded-core.git/commitdiff
bitbake/build.py: Ditch the extract_stamp function as its just going to complicate...
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 6 Jan 2011 15:41:39 +0000 (15:41 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 6 Jan 2011 15:41:39 +0000 (15:41 +0000)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/build.py

index 2d8fe8be84e172a6beffd2e1adce360e7219d4c9..38dab5ff1e7ff0040177dc4b3ff099b9a58878bc 100644 (file)
@@ -373,25 +373,24 @@ def exec_task(fn, task, d):
             event.fire(failedevent, d)
         return 1
 
-def extract_stamp(d, fn):
-    """
-    Extracts stamp format which is either a data dictionary (fn unset)
-    or a dataCache entry (fn set).
-    """
-    if fn:
-        return d.stamp[fn]
-    return data.getVar('STAMP', d, 1)
-
 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
+
+    In the bitbake core, d can be a CacheData and file_name will be set.
+    When called in task context, d will be a data store, file_name will not be set
     """
-    stamp = extract_stamp(d, file_name)
+    if file_name:
+        stamp = d.stamp[file_name]
+    else:
+        stamp = d.getVar('STAMP', True)
+
     if not stamp:
         return
+
     stamp = "%s.%s" % (stamp, task)
     bb.utils.mkdirhier(os.path.dirname(stamp))
     # Remove the file and recreate to force timestamp