2005-08-31 10:45:47 +00:00
|
|
|
#
|
|
|
|
# Removes source after build
|
|
|
|
#
|
|
|
|
# To use it add that line to conf/local.conf:
|
|
|
|
#
|
|
|
|
# INHERIT += "rm_work"
|
|
|
|
#
|
|
|
|
|
2010-11-28 14:59:37 +00:00
|
|
|
# Use the completion scheulder by default when rm_work is active
|
|
|
|
# to try and reduce disk usage
|
|
|
|
BB_SCHEDULER ?= "completion"
|
|
|
|
|
2007-09-01 16:45:43 +00:00
|
|
|
RMWORK_ORIG_TASK := "${BB_DEFAULT_TASK}"
|
|
|
|
BB_DEFAULT_TASK = "rm_work_all"
|
|
|
|
|
2005-08-31 10:45:47 +00:00
|
|
|
do_rm_work () {
|
|
|
|
cd ${WORKDIR}
|
|
|
|
for dir in *
|
|
|
|
do
|
2007-02-21 17:21:43 +00:00
|
|
|
if [ `basename ${S}` = $dir ]; then
|
2007-09-01 16:45:43 +00:00
|
|
|
rm -rf $dir
|
2011-02-03 11:34:04 +00:00
|
|
|
# The package and package-split directories are retained by sstate for
|
|
|
|
# do_package so we retain them here too. Anything in sstate 'plaindirs'
|
|
|
|
# should be retained. Also retain logs and other files in temp.
|
|
|
|
elif [ $dir != 'temp' ] && [ $dir != 'package' ] && [ $dir != 'package-split' ]; then
|
2005-08-31 10:45:47 +00:00
|
|
|
rm -rf $dir
|
|
|
|
fi
|
|
|
|
done
|
2010-10-12 14:52:07 +00:00
|
|
|
# Need to add pseudo back or subsqeuent work in this workdir
|
|
|
|
# might fail since setscene may not rerun to recreate it
|
|
|
|
mkdir ${WORKDIR}/pseudo/
|
2011-01-27 11:05:14 +00:00
|
|
|
|
|
|
|
# Change normal stamps into setscene stamps as they better reflect the
|
|
|
|
# fact WORKDIR is now empty
|
|
|
|
cd `dirname ${STAMP}`
|
|
|
|
for i in `basename ${STAMP}`*
|
|
|
|
do
|
|
|
|
for j in ${SSTATETASKS}
|
|
|
|
do
|
|
|
|
case $i in
|
|
|
|
*do_setscene*)
|
|
|
|
break
|
|
|
|
;;
|
|
|
|
*_setscene*)
|
|
|
|
i=dummy
|
|
|
|
break
|
|
|
|
;;
|
|
|
|
*$j|*$j.*)
|
|
|
|
mv $i `echo $i | sed -e "s#${j}#${j}_setscene#"`
|
|
|
|
i=dummy
|
|
|
|
break
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
rm -f $i
|
|
|
|
done
|
2005-08-31 10:45:47 +00:00
|
|
|
}
|
2007-09-01 16:45:43 +00:00
|
|
|
addtask rm_work after do_${RMWORK_ORIG_TASK}
|
2005-08-31 10:45:47 +00:00
|
|
|
|
2007-09-01 16:45:43 +00:00
|
|
|
do_rm_work_all () {
|
|
|
|
:
|
2007-08-08 20:41:55 +00:00
|
|
|
}
|
2007-09-01 16:45:43 +00:00
|
|
|
do_rm_work_all[recrdeptask] = "do_rm_work"
|
|
|
|
addtask rm_work_all after do_rm_work
|