aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/sstate-cache-management.sh
diff options
context:
space:
mode:
authorMartin Jansa <martin.jansa@gmail.com>2014-01-29 22:03:41 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-02-02 11:28:41 +0000
commit54e6e25f1a369fa6c21ce0f9db3479b1a481825f (patch)
treef40e8e5e7efbafd0e20cd411e6d67f9080ea5d18 /scripts/sstate-cache-management.sh
parentaa36f9c9b5abac58de899f98803d1c4375678044 (diff)
downloadopenembedded-core-contrib-54e6e25f1a369fa6c21ce0f9db3479b1a481825f.tar.gz
sstate-cache-management.sh: Show total number of files when showing how many will be deleted
* it's good to see some the ratio of delted files until now it was showing only when all or none files were to be removed 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.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/sstate-cache-management.sh b/scripts/sstate-cache-management.sh
index 30ba8c62416..035bb25f898 100755
--- a/scripts/sstate-cache-management.sh
+++ b/scripts/sstate-cache-management.sh
@@ -95,7 +95,7 @@ do_nothing () {
# Read the input "y"
read_confirm () {
- echo -n "$total_deleted files will be removed! "
+ echo -n "$total_deleted from $total_files files will be removed! "
if [ "$confirm" != "y" ]; then
echo -n "Do you want to continue (y/n)? "
while read confirm; do
@@ -186,6 +186,8 @@ remove_duplicated () {
| sed -e 's/-/_/g' -e 's/ /\n/g' | sort -u)
echo "Done"
+ # Total number of files including sstate-, sigdata and .done files
+ total_files=`find $cache_dir -name 'sstate*' | wc -l`
# Save all the sstate files in a file
sstate_list=`mktemp` || exit 1
find $cache_dir -name 'sstate:*:*:*:*:*:*:*.tgz' >$sstate_list
@@ -212,6 +214,8 @@ remove_duplicated () {
local remove_listdir=`mktemp -d` || exit 1
for suffix in $sstate_suffixes; do
+ # Total number of files including sigdata and .done files
+ total_files_suffix=`grep ".*/sstate:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:_]*_$suffix.*" $sstate_list | wc -l 2>/dev/null`
# Save the file list to a file, some suffix's file may not exist
grep ".*/sstate:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:_]*_$suffix.tgz" $sstate_list >$list_suffix 2>/dev/null
local deleted=0
@@ -258,7 +262,7 @@ remove_duplicated () {
done
[ ! -s "$rm_list" ] || deleted=`cat $rm_list | wc -l`
[ -s "$rm_list" -a $debug -gt 0 ] && cat $rm_list
- echo "($deleted files will be removed)"
+ echo "($deleted from $total_files_suffix files for $suffix suffix will be removed)"
let total_deleted=$total_deleted+$deleted
done
deleted=0
@@ -319,6 +323,8 @@ rm_by_stamps (){
done
echo "Done"
+ # Total number of files including sstate-, sigdata and .done files
+ total_files=`find $cache_dir -name 'sstate*' | wc -l`
# Save all the state file list to a file
find $cache_dir -name 'sstate*.tgz' | sort -u -o $cache_list