summaryrefslogtreecommitdiff
path: root/openembedded/classes/rm_work.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'openembedded/classes/rm_work.bbclass')
-rw-r--r--openembedded/classes/rm_work.bbclass22
1 files changed, 22 insertions, 0 deletions
diff --git a/openembedded/classes/rm_work.bbclass b/openembedded/classes/rm_work.bbclass
new file mode 100644
index 0000000000..340446917e
--- /dev/null
+++ b/openembedded/classes/rm_work.bbclass
@@ -0,0 +1,22 @@
+#
+# Removes source after build
+#
+# To use it add that line to conf/local.conf:
+#
+# INHERIT += "rm_work"
+#
+
+do_rm_work () {
+ cd ${WORKDIR}
+ for dir in *
+ do
+ if [ `basename ${S}` == $dir ]; then
+ rm -rf $dir/*
+ elif [ $dir != 'temp' ]; then
+ rm -rf $dir
+ fi
+ done
+}
+
+addtask rm_work before do_build
+addtask rm_work after do_package