mirror of
https://git.yoctoproject.org/poky
synced 2026-06-02 01:19:52 +00:00
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: 494fcfcb7c4469915c67f544997104d81c417266) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 4d671504a25863018ac51c21c005cef0a4d8f05c) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -835,11 +835,7 @@ def stamp_cleanmask_internal(taskname, d, file_name):
|
|||||||
|
|
||||||
return [cleanmask, cleanmask.replace(taskflagname, taskflagname + "_setscene")]
|
return [cleanmask, cleanmask.replace(taskflagname, taskflagname + "_setscene")]
|
||||||
|
|
||||||
def make_stamp(task, d, file_name = None):
|
def clean_stamp(task, d, file_name = None):
|
||||||
"""
|
|
||||||
Creates/updates a stamp for a given task
|
|
||||||
(d can be a data dict or dataCache)
|
|
||||||
"""
|
|
||||||
cleanmask = stamp_cleanmask_internal(task, d, file_name)
|
cleanmask = stamp_cleanmask_internal(task, d, file_name)
|
||||||
for mask in cleanmask:
|
for mask in cleanmask:
|
||||||
for name in glob.glob(mask):
|
for name in glob.glob(mask):
|
||||||
@@ -850,6 +846,14 @@ def make_stamp(task, d, file_name = None):
|
|||||||
if name.endswith('.taint'):
|
if name.endswith('.taint'):
|
||||||
continue
|
continue
|
||||||
os.unlink(name)
|
os.unlink(name)
|
||||||
|
return
|
||||||
|
|
||||||
|
def make_stamp(task, d, file_name = None):
|
||||||
|
"""
|
||||||
|
Creates/updates a stamp for a given task
|
||||||
|
(d can be a data dict or dataCache)
|
||||||
|
"""
|
||||||
|
clean_stamp(task, d, file_name)
|
||||||
|
|
||||||
stamp = stamp_internal(task, d, file_name)
|
stamp = stamp_internal(task, d, file_name)
|
||||||
# Remove the file and recreate to force timestamp
|
# Remove the file and recreate to force timestamp
|
||||||
|
|||||||
Reference in New Issue
Block a user