summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Dechesne <nicolas.dechesne@linaro.org>2013-12-16 11:16:12 +0100
committerNicolas Dechesne <nicolas.dechesne@linaro.org>2013-12-16 11:54:47 +0100
commit90757635b2d24b345511799d3f699442e560e54d (patch)
treea4080612cf2a8441247b2f05e2e540a58e24c753
parent866b02f6501e6a9f950737663ca85064d5c7edb3 (diff)
functions.sh: query bitbake to get SSTATE_DIR instead of hard-coding
This will be needed later when we can customize the SSTATE_DIR location Change-Id: Ied28f20c62e966afe4ff9f48da80c86dcf92c847 Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
-rwxr-xr-xfunctions.sh13
1 files changed, 9 insertions, 4 deletions
diff --git a/functions.sh b/functions.sh
index 5ae113e..b16467a 100755
--- a/functions.sh
+++ b/functions.sh
@@ -223,15 +223,17 @@ conf_localconf()
cleanup_soft()
{
- if [ -e "${WORKBASE}/sstate-cache" ]; then
- echo "soft cleanup at ${WORKBASE}"
+ sstate_dir=`bitbake -e | grep "^SSTATE_DIR="| cut -d'=' -f2 | tr -d '"'`
+
+ if [ -e "$sstate_dir" ]; then
+ echo "soft cleanup at $sstate_dir"
df -h ${WORKBASE}
extra_layers=`bitbake-layers show-layers | awk 'NR>2 {print $2}' | tr "\\n" ","`
echo $extra_layers
../openembedded-core/scripts/sstate-cache-management.sh --yes --remove-duplicated \
-d -v \
--extra-layer=$extra_layers \
- --cache-dir=${WORKBASE}/sstate-cache
+ --cache-dir=$sstate_dir
df -h ${WORKBASE}
../openembedded-core/scripts/cleanup-workdir
df -h ${WORKBASE}
@@ -245,7 +247,10 @@ cleanup_hard()
if [ -n "${WORKBASE}" ]; then
echo "hard cleanup at ${WORKBASE}"
df -h ${WORKBASE}
- rm -rf ${WORKBASE}/sstate-cache
+ sstate_dir=`bitbake -e | grep "^SSTATE_DIR="| cut -d'=' -f2 | tr -d '"'`
+ if [ -n "$sstate_dir" ]; then
+ rm -rf $sstate_dir
+ fi
#rm -rf ${WORKBASE}/downloads
df -h ${WORKBASE}
fi