diff options
author | Martin Jansa <martin.jansa@gmail.com> | 2014-03-29 11:34:11 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-03-30 10:10:35 +0100 |
commit | 07e632a26c6c922c926d6a695e6f342646665adf (patch) | |
tree | 5b600ad25c7c20c9c431186d24a1b23ab1d072ff /scripts/sstate-cache-management.sh | |
parent | 42b12dc544b3344067b87f7b8ec2391f21e30022 (diff) | |
download | ast2050-yocto-poky-07e632a26c6c922c926d6a695e6f342646665adf.zip ast2050-yocto-poky-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/sstate-cache-management.sh')
-rwxr-xr-x | scripts/sstate-cache-management.sh | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/sstate-cache-management.sh b/scripts/sstate-cache-management.sh index 34bde01..ffda05e 100755 --- a/scripts/sstate-cache-management.sh +++ b/scripts/sstate-cache-management.sh @@ -341,9 +341,9 @@ rm_by_stamps (){ echo "Done" # Total number of files including sstate-, .siginfo and .done files - total_files=`find $cache_dir -name 'sstate*' | wc -l` + total_files=`find $cache_dir -type f -name 'sstate*' | wc -l` # Save all the state file list to a file - find $cache_dir -name 'sstate*.tgz' | sort -u -o $cache_list + 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 @@ -355,14 +355,14 @@ 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 | sort -u | wc -w` if [ $total_deleted -gt 0 ]; then - [ $debug -gt 0 ] && cat $rm_list + [ $debug -gt 0 ] && cat $rm_list | sort -u read_confirm if [ "$confirm" = "y" -o "$confirm" = "Y" ]; then echo "Removing sstate cache files ... ($total_deleted files)" # Remove them one by one to avoid the argument list too long error - for i in `cat $rm_list`; do + for i in `cat $rm_list | sort -u`; do rm -f $verbose $i done echo "$total_deleted files have been removed" |