summaryrefslogtreecommitdiff
path: root/scripts/sstate-cache-management.sh
diff options
context:
space:
mode:
authorMartin Jansa <martin.jansa@gmail.com>2014-03-29 11:34:13 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-03-30 10:02:21 +0100
commitdfdb397db5865c3287cd9ccb5ea9a336eb77ca90 (patch)
tree07981fcf36bd8bfbcb4805ca0700b1ebf414404a /scripts/sstate-cache-management.sh
parent9ae16469e70714acf7cb1e6c5238934a6b20d58a (diff)
downloadopenembedded-core-dfdb397db5865c3287cd9ccb5ea9a336eb77ca90.tar.gz
openembedded-core-dfdb397db5865c3287cd9ccb5ea9a336eb77ca90.tar.bz2
openembedded-core-dfdb397db5865c3287cd9ccb5ea9a336eb77ca90.zip
sstate-cache-management: rm_by_stamps - discover all suffixes like remove_duplicated does
* instead of hard coding list of sstate enabled task use the same function as remove_duplicated to find them in sstate-cache directory Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/sstate-cache-management.sh')
-rwxr-xr-xscripts/sstate-cache-management.sh20
1 files changed, 11 insertions, 9 deletions
diff --git a/scripts/sstate-cache-management.sh b/scripts/sstate-cache-management.sh
index 77afd68989..e5c57d318d 100755
--- a/scripts/sstate-cache-management.sh
+++ b/scripts/sstate-cache-management.sh
@@ -324,16 +324,23 @@ rm_by_stamps (){
local cache_list=`mktemp` || exit 1
local keep_list=`mktemp` || exit 1
local rm_list=`mktemp` || exit 1
- local suffixes
local sums
local all_sums
- suffixes="populate_sysroot populate_lic package_write_ipk \
- package_write_rpm package_write_deb package packagedata deploy"
+ # Total number of files including sstate-, .siginfo and .done files
+ total_files=`find $cache_dir -type f -name 'sstate*' | wc -l`
+ # Save all the state file list to a file
+ find $cache_dir -type f -name 'sstate*' | sort -u -o $cache_list
+
+ echo "Figuring out the suffixes in the sstate cache dir ... "
+ local sstate_suffixes="`sed 's%.*/sstate:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^_]*_\([^:]*\)\.tgz.*%\1%g' $cache_list | sort -u`"
+ echo "Done"
+ echo "The following suffixes have been found in the cache dir:"
+ echo $sstate_suffixes
# Figure out all the md5sums in the stamps dir.
echo "Figuring out all the md5sums in stamps dir ... "
- for i in $suffixes; do
+ for i in $sstate_suffixes; do
# There is no "\.sigdata" but "_setcene" when it is mirrored
# from the SSTATE_MIRRORS, use them to figure out the sum.
sums=`find $stamps -maxdepth 3 -name "*.do_$i.*" \
@@ -344,11 +351,6 @@ rm_by_stamps (){
done
echo "Done"
- # Total number of files including sstate-, .siginfo and .done files
- total_files=`find $cache_dir -type f -name 'sstate*' | wc -l`
- # Save all the state file list to a file
- find $cache_dir -type f -name 'sstate*' | sort -u -o $cache_list
-
echo "Figuring out the files which will be removed ... "
for i in $all_sums; do
grep ".*/sstate:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:${i}_.*" $cache_list >>$keep_list