Patchwork [2/5] sstate-cache-management.sh: Fix rm_by_stamps() to work after SSTATE_SWSPEC change

login
register
mail settings
Submitter Martin Jansa
Date Jan. 29, 2014, 9:03 p.m.
Message ID <6743a468ee4ec24dcbfad743aed12bafeb111b3e.1391027849.git.Martin.Jansa@gmail.com>
Download mbox | patch
Permalink /patch/66047/
State New
Headers show

Comments

Martin Jansa - Jan. 29, 2014, 9:03 p.m.
* format of filenames for sstate archives was changed in:
  commit 6f823a23c5f1d0ffa0a27db1c1bc1907de788505
  Author: Richard Purdie <richard.purdie@linuxfoundation.org>
  Date:   Fri Dec 20 12:06:02 2013 +0000
  Subject: sstate: Convert to use ':' as a filename sperator and use SSTATE_SWSPEC globally
* this one doesn't need special care for old sstate- names
  they will be removed automatically as they don't match with
  any checksum in rigth format from stamps directory

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 scripts/sstate-cache-management.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Patch

diff --git a/scripts/sstate-cache-management.sh b/scripts/sstate-cache-management.sh
index 21ca470..30ba8c6 100755
--- a/scripts/sstate-cache-management.sh
+++ b/scripts/sstate-cache-management.sh
@@ -320,11 +320,11 @@  rm_by_stamps (){
   echo "Done"
 
   # Save all the state file list to a file
-  find $cache_dir -name 'sstate-*.tgz' | sort -u -o $cache_list
+  find $cache_dir -name 'sstate*.tgz' | sort -u -o $cache_list
 
   echo -n "Figuring out the files which will be removed ... "
   for i in $all_sums; do
-      grep ".*-${i}_.*" $cache_list >>$keep_list
+      grep ".*/sstate:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:${i}_.*" $cache_list >>$keep_list
   done
   echo "Done"
 
@@ -332,7 +332,7 @@  rm_by_stamps (){
       sort -u $keep_list -o $keep_list
       to_del=`comm -1 -3 $keep_list $cache_list`
       gen_rmlist $rm_list "$to_del"
-      let total_deleted=(`cat $rm_list | wc -w`)
+      let total_deleted=`cat $rm_list | wc -w`
       if [ $total_deleted -gt 0 ]; then
           [ $debug -gt 0 ] && cat $rm_list
           read_confirm