From: Joel Rosdahl Date: Sun, 13 Dec 2009 15:01:29 +0000 (+0100) Subject: Remove no longer functional manage-cache.sh X-Git-Tag: v3.0pre0~132 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9fa541fd13079aab467cb90d408454c1ae0aa8af;p=thirdparty%2Fccache.git Remove no longer functional manage-cache.sh --- diff --git a/manage-cache.sh b/manage-cache.sh deleted file mode 100644 index cb22ade79..000000000 --- a/manage-cache.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash -# -# 2004-05-12 lars@gustaebel.de - -CCACHE_DIR=${CCACHE_DIR:-$HOME/.ccache} - -echo "Do you want to compress or decompress the ccache in $CCACHE_DIR?" -read -p "Type c or d: " mode - -if [ "$mode" != "c" ] && [ "$mode" != "d" ] -then - exit 1 -fi - -is_compressed() { - test "$(head -c 2 $1)" = $'\x1f\x8b' - return $? -} - -tmpfile=$(mktemp) - -for dir in 0 1 2 3 4 5 6 7 8 9 a b c d e f -do - # process ccache subdir - echo -n "$dir " - - # find cache files - find $CCACHE_DIR/$dir -type f -name '*-*' | - sort > $tmpfile - - oldsize=$(cat $CCACHE_DIR/$dir/stats | cut -d ' ' -f 13) - newsize=0 - - while read file - do - # empty files will be ignored since compressing - # them makes them bigger - test $(stat -c %s $file) -eq 0 && continue - - if [ $mode = c ] - then - if ! is_compressed $file - then - gzip $file - mv $file.gz $file - fi - else - if is_compressed $file - then - mv $file $file.gz - gzip -d $file.gz - fi - fi - - # calculate new size statistic for this subdir - let newsize=$newsize+$(stat -c "%B*%b" $file)/1024 - done < $tmpfile - - # update statistic file - read -a numbers < $CCACHE_DIR/$dir/stats - numbers[12]=$newsize - echo "${numbers[*]} " > $CCACHE_DIR/$dir/stats -done -echo - -# clean up -rm $tmpfile