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