[oe-commits] Rolf Leggewie : WIP: make my own rm_work class that does not depend on do_build and keeps stamps intact
git version control
git at git.openembedded.org
Sat Jun 13 15:13:53 UTC 2009
Module: openembedded.git
Branch: org.openembedded.dev
Commit: 28c50febb8bd094fcf727dfb1c761759c7219dbf
URL: http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=28c50febb8bd094fcf727dfb1c761759c7219dbf
Author: Rolf Leggewie <oe-devel at rolf.leggewie.biz>
Date: Fri Jun 12 10:33:24 2009 +0900
WIP: make my own rm_work class that does not depend on do_build and keeps stamps intact
maybe I should extend the existing class with a variable
---
classes/rl_rm_work.bbclass | 55 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 55 insertions(+), 0 deletions(-)
diff --git a/classes/rl_rm_work.bbclass b/classes/rl_rm_work.bbclass
new file mode 100644
index 0000000..ba808b5
--- /dev/null
+++ b/classes/rl_rm_work.bbclass
@@ -0,0 +1,55 @@
+# http://git.openmoko.org/?p=openmoko.git;a=blob;f=classes/om-utils.bbclass;h=5c0464ef856f6d504488d522e3d602f971f65d8f;hb=HEAD
+# (18:23:52) hrw: Laibsch: basically you need rm_work.bbclass without addhandler rmwork_stampfixing_eventhandler
+#
+# Removes source after build
+#
+# To use it add that line to conf/local.conf:
+#
+# INHERIT += "rm_work"
+#
+
+# Use the completion scheduler by default when rm_work is active
+# to try and reduce disk usage
+BB_SCHEDULER ?= "completion"
+
+RMWORK_ORIG_TASK := "${BB_DEFAULT_TASK}"
+BB_DEFAULT_TASK = "rm_work_all"
+
+do_rm_work () {
+ cd ${WORKDIR}
+ for dir in *
+ do
+ if [ `basename ${dir}` = "temp" ]; then
+ echo "Not removing temp"
+ else
+ echo "Removing $dir" ; rm $dir -rf
+ fi
+ done
+}
+addtask rm_work after do_${RMWORK_ORIG_TASK}
+
+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
+}
+
More information about the Openembedded-commits
mailing list