remove-unused-sources: Include peak files in deletion and size calculation.

This commit is contained in:
Jonathan Moore Liles 2008-12-06 00:56:55 -06:00
parent 6f53a6fc10
commit a701d53265
1 changed files with 4 additions and 2 deletions

View File

@ -59,10 +59,12 @@ remove_sources ()
local TOTAL=0 local TOTAL=0
local FILE local FILE
local SIZE local SIZE
local PSIZE
while read FILE while read FILE
do do
SIZE=`stat -c '%s' "${FILE}" 2>/dev/null` SIZE=`stat -c '%s' "${FILE}" 2>/dev/null`
PSIZE=`stat -c '%s' "${FILE}.peak" 2>/dev/null`
if [ $? -ne 0 ] if [ $? -ne 0 ]
then then
@ -73,10 +75,10 @@ remove_sources ()
echo "Would remove: ${FILE}" echo "Would remove: ${FILE}"
else else
echo "Removing unused source \"${FILE}\"..." echo "Removing unused source \"${FILE}\"..."
rm -f ./"${FILE}" ./"${FILE}-"*.peak rm -f ./"${FILE}" ./"${FILE}".peak
fi fi
TOTAL=$(( $TOTAL + $SIZE )) TOTAL=$(( $TOTAL + $SIZE + $PSIZE ))
fi fi
done done