summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-05-16 11:11:14 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-05-16 23:19:18 +0100
commitb8b3413a9c9898291005b17f13a02e37b0c4c758 (patch)
treeb55e55b3b4e48d218e38a65d7aa3ee92c686dbfa
parent76310f35dd0d2c36747060ce99901e3f0d0cc7aa (diff)
downloadpoky-b8b3413a9c9898291005b17f13a02e37b0c4c758.tar.gz
bitbake: build: Add clean_stamp API function to allow removal of task stamps
We currently have no API to be able to remove all the potential stamps of a task. It is unusual to need to do this, particularly as you could race against other things happening in the system but we do have a use case for this in cleaning up sysroots in OE-Core. The alternative is to mess with CLEANMASK in OE-Core but that is just going to add potential for errors. We need the first part of the make_stamp() function so separate that out so it can be called seperately. (Bitbake rev: 4d671504a25863018ac51c21c005cef0a4d8f05c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/build.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
index af60c3d8f5..55f68b98c5 100644
--- a/bitbake/lib/bb/build.py
+++ b/bitbake/lib/bb/build.py
@@ -835,11 +835,7 @@ def stamp_cleanmask_internal(taskname, d, file_name):
835 835
836 return [cleanmask, cleanmask.replace(taskflagname, taskflagname + "_setscene")] 836 return [cleanmask, cleanmask.replace(taskflagname, taskflagname + "_setscene")]
837 837
838def make_stamp(task, d, file_name = None): 838def clean_stamp(task, d, file_name = None):
839 """
840 Creates/updates a stamp for a given task
841 (d can be a data dict or dataCache)
842 """
843 cleanmask = stamp_cleanmask_internal(task, d, file_name) 839 cleanmask = stamp_cleanmask_internal(task, d, file_name)
844 for mask in cleanmask: 840 for mask in cleanmask:
845 for name in glob.glob(mask): 841 for name in glob.glob(mask):
@@ -850,6 +846,14 @@ def make_stamp(task, d, file_name = None):
850 if name.endswith('.taint'): 846 if name.endswith('.taint'):
851 continue 847 continue
852 os.unlink(name) 848 os.unlink(name)
849 return
850
851def make_stamp(task, d, file_name = None):
852 """
853 Creates/updates a stamp for a given task
854 (d can be a data dict or dataCache)
855 """
856 clean_stamp(task, d, file_name)
853 857
854 stamp = stamp_internal(task, d, file_name) 858 stamp = stamp_internal(task, d, file_name)
855 # Remove the file and recreate to force timestamp 859 # Remove the file and recreate to force timestamp