summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMartin Jansa <martin.jansa@gmail.com>2014-03-29 11:34:11 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-03-30 10:10:35 +0100
commit07e632a26c6c922c926d6a695e6f342646665adf (patch)
tree5b600ad25c7c20c9c431186d24a1b23ab1d072ff /scripts
parent42b12dc544b3344067b87f7b8ec2391f21e30022 (diff)
downloadpoky-07e632a26c6c922c926d6a695e6f342646665adf.tar.gz
sstate-cache-management: rm_by_stamps - remove .siginfo and .done files
* it's possible that corresponding .tgz files were already removed (e.g. with -d option and older version of this script) and this won't find orphaned .siginfo or .done files to remove * add sort -u to count files found multiple times only once (From OE-Core rev: 5a58cd2474ed96d6f58576203bedf8211d309c99) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/sstate-cache-management.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/sstate-cache-management.sh b/scripts/sstate-cache-management.sh
index 34bde01970..ffda05ea3e 100755
--- a/scripts/sstate-cache-management.sh
+++ b/scripts/sstate-cache-management.sh
@@ -341,9 +341,9 @@ rm_by_stamps (){
341 echo "Done" 341 echo "Done"
342 342
343 # Total number of files including sstate-, .siginfo and .done files 343 # Total number of files including sstate-, .siginfo and .done files
344 total_files=`find $cache_dir -name 'sstate*' | wc -l` 344 total_files=`find $cache_dir -type f -name 'sstate*' | wc -l`
345 # Save all the state file list to a file 345 # Save all the state file list to a file
346 find $cache_dir -name 'sstate*.tgz' | sort -u -o $cache_list 346 find $cache_dir -type f -name 'sstate*' | sort -u -o $cache_list
347 347
348 echo "Figuring out the files which will be removed ... " 348 echo "Figuring out the files which will be removed ... "
349 for i in $all_sums; do 349 for i in $all_sums; do
@@ -355,14 +355,14 @@ rm_by_stamps (){
355 sort -u $keep_list -o $keep_list 355 sort -u $keep_list -o $keep_list
356 to_del=`comm -1 -3 $keep_list $cache_list` 356 to_del=`comm -1 -3 $keep_list $cache_list`
357 gen_rmlist $rm_list "$to_del" 357 gen_rmlist $rm_list "$to_del"
358 let total_deleted=`cat $rm_list | wc -w` 358 let total_deleted=`cat $rm_list | sort -u | wc -w`
359 if [ $total_deleted -gt 0 ]; then 359 if [ $total_deleted -gt 0 ]; then
360 [ $debug -gt 0 ] && cat $rm_list 360 [ $debug -gt 0 ] && cat $rm_list | sort -u
361 read_confirm 361 read_confirm
362 if [ "$confirm" = "y" -o "$confirm" = "Y" ]; then 362 if [ "$confirm" = "y" -o "$confirm" = "Y" ]; then
363 echo "Removing sstate cache files ... ($total_deleted files)" 363 echo "Removing sstate cache files ... ($total_deleted files)"
364 # Remove them one by one to avoid the argument list too long error 364 # Remove them one by one to avoid the argument list too long error
365 for i in `cat $rm_list`; do 365 for i in `cat $rm_list | sort -u`; do
366 rm -f $verbose $i 366 rm -f $verbose $i
367 done 367 done
368 echo "$total_deleted files have been removed" 368 echo "$total_deleted files have been removed"