From b9c6764ba5a7f2d439088f42d7d2b82403f2e2b0 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Tue, 26 Feb 2008 17:54:55 +0000 Subject: rm_work.bbclass: Add event handler to take care of removing stamps when trying to rebuild packages after sources have been removed. Needs bitbake 1.8 svn to have any effect. --- classes/rm_work.bbclass | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/classes/rm_work.bbclass b/classes/rm_work.bbclass index 4efd39c557..97de5e2774 100644 --- a/classes/rm_work.bbclass +++ b/classes/rm_work.bbclass @@ -25,3 +25,23 @@ do_rm_work_all () { } do_rm_work_all[recrdeptask] = "do_rm_work" addtask rm_work_all after do_rm_work + + +addhandler rmwork_stampfixing_eventhandler +python rmwork_stampfixing_eventhandler() { + from bb.event import getName + import os + + if getName(e) == "StampUpdate": + for (fn, task) in e.targets: + if task == 'rm_work_all': + continue + stamp = "%s.do_rm_work" % e.stampPrefix[fn] + if os.path.exists(stamp): + dir = "%s.*" % e.stampPrefix[fn] + bb.note("Removing stamps: " + dir) + os.system('rm -f '+ dir) + + return NotHandled +} + -- cgit v1.2.3