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 ${dir}` = "temp" ]; then
21 echo "Not removing temp"
23 echo "Removing $dir" ; rm -rf $dir
27 addtask rm_work after do_${RMWORK_ORIG_TASK}
32 do_rm_work_all[recrdeptask] = "do_rm_work"
33 addtask rm_work_all after do_rm_work
36 addhandler rmwork_stampfixing_eventhandler
37 python rmwork_stampfixing_eventhandler() {
38 if bb.event.getName(e) == "StampUpdate":
39 for (fn, task) in e.targets:
40 if task == 'rm_work_all':
42 stamp = "%s.do_rm_work" % e.stampPrefix[fn]
43 if os.path.exists(stamp):
44 dir = "%s.*" % e.stampPrefix[fn]
45 bb.note("Removing stamps: " + dir)
46 os.system('rm -f '+ dir)