summaryrefslogtreecommitdiffstats
path: root/scripts/sstate-cache-management.sh
diff options
context:
space:
mode:
authorMartin Jansa <martin.jansa@gmail.com>2014-03-29 10:34:13 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-03-30 09:10:35 (GMT)
commit3f0425dc12655e9d513e26788a2217aaaec1d0e0 (patch)
treef62cebb0b75f15acf0fc0f0e6a04a57cd752172f /scripts/sstate-cache-management.sh
parentfec6bd763fad87c72d580ab1a482932ea5f37db7 (diff)
downloadpoky-3f0425dc12655e9d513e26788a2217aaaec1d0e0.tar.gz
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 (From OE-Core rev: dfdb397db5865c3287cd9ccb5ea9a336eb77ca90) 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 77afd68..e5c57d3 100755
--- a/scripts/sstate-cache-management.sh
+++ b/scripts/sstate-cache-management.sh
@@ -324,16 +324,23 @@ rm_by_stamps (){
324 local cache_list=`mktemp` || exit 1 324 local cache_list=`mktemp` || exit 1
325 local keep_list=`mktemp` || exit 1 325 local keep_list=`mktemp` || exit 1
326 local rm_list=`mktemp` || exit 1 326 local rm_list=`mktemp` || exit 1
327 local suffixes
328 local sums 327 local sums
329 local all_sums 328 local all_sums
330 329
331 suffixes="populate_sysroot populate_lic package_write_ipk \ 330 # Total number of files including sstate-, .siginfo and .done files
332 package_write_rpm package_write_deb package packagedata deploy" 331 total_files=`find $cache_dir -type f -name 'sstate*' | wc -l`
332 # Save all the state file list to a file
333 find $cache_dir -type f -name 'sstate*' | sort -u -o $cache_list
334
335 echo "Figuring out the suffixes in the sstate cache dir ... "
336 local sstate_suffixes="`sed 's%.*/sstate:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^_]*_\([^:]*\)\.tgz.*%\1%g' $cache_list | sort -u`"
337 echo "Done"
338 echo "The following suffixes have been found in the cache dir:"
339 echo $sstate_suffixes
333 340
334 # Figure out all the md5sums in the stamps dir. 341 # Figure out all the md5sums in the stamps dir.
335 echo "Figuring out all the md5sums in stamps dir ... " 342 echo "Figuring out all the md5sums in stamps dir ... "
336 for i in $suffixes; do 343 for i in $sstate_suffixes; do
337 # There is no "\.sigdata" but "_setcene" when it is mirrored 344 # There is no "\.sigdata" but "_setcene" when it is mirrored
338 # from the SSTATE_MIRRORS, use them to figure out the sum. 345 # from the SSTATE_MIRRORS, use them to figure out the sum.
339 sums=`find $stamps -maxdepth 3 -name "*.do_$i.*" \ 346 sums=`find $stamps -maxdepth 3 -name "*.do_$i.*" \
@@ -344,11 +351,6 @@ rm_by_stamps (){
344 done 351 done
345 echo "Done" 352 echo "Done"
346 353
347 # Total number of files including sstate-, .siginfo and .done files
348 total_files=`find $cache_dir -type f -name 'sstate*' | wc -l`
349 # Save all the state file list to a file
350 find $cache_dir -type f -name 'sstate*' | sort -u -o $cache_list
351
352 echo "Figuring out the files which will be removed ... " 354 echo "Figuring out the files which will be removed ... "
353 for i in $all_sums; do 355 for i in $all_sums; do
354 grep ".*/sstate:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:${i}_.*" $cache_list >>$keep_list 356 grep ".*/sstate:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:${i}_.*" $cache_list >>$keep_list