2 # Removes source after build
4 # To use it add that line to conf/local.conf:
9 # Use the completion scheulder by default when rm_work is active
10 # to try and reduce disk usage
11 BB_SCHEDULER ?= "completion"
13 RMWORK_ORIG_TASK := "${BB_DEFAULT_TASK}"
14 BB_DEFAULT_TASK = "rm_work_all"
20 if [ `basename ${S}` = $dir ]; then
25 addtask rm_work after do_${RMWORK_ORIG_TASK}
30 do_rm_work_all[recrdeptask] = "do_rm_work"
31 addtask rm_work_all after do_rm_work
34 addhandler rmwork_stampfixing_eventhandler
35 python rmwork_stampfixing_eventhandler() {
36 from bb.event import getName
39 if getName(e) == "StampUpdate":
40 for (fn, task) in e.targets:
41 if task == 'rm_work_all':
43 stamp = "%s.do_rm_work" % e.stampPrefix[fn]
44 if os.path.exists(stamp):
45 dir = "%s.*" % e.stampPrefix[fn]
46 bb.note("Removing stamps: " + dir)
47 os.system('rm -f '+ dir)