#!/bin/sh
#
# growthplot -- plot the fetchmail project's growth as a function of time
#
# Get data from the NEWS file
timeseries >/tmp/growthplot$$
grep "^[0-9]" /tmp/growthplot$$ >/tmp/growthnumbers$$
grep "^[0-9.]*.[05].0 " /tmp/growthplot$$ >/tmp/growthmajors$$
sed '/^4.2.9/,$d' /tmp/growthannounce$$
cat >/tmp/growthimage$$ <lasttotal))
then
# Label over curve hanging right, arrow down
arrowhead=$((lasttotal+50))
echo "set label '$legend' at $lastday-10, $endy+15"
else
# Label under curve hanging left, arrow up
arrowhead=$((lasttotal-5))
strlen=`python -c "print len('$legend')"`
lablen=$((strlen*22))
echo "set label '$legend' at $lastday-$lablen+10, $endy-15"
fi
echo set arrow \
from $lastday, $endy \
to $lastday, $arrowhead \
head
else
set -- $legend
size=$1
friends=$2
announce=$3
total=$4
days=$5
date=$6
lastday=$days
lasttotal=$total
fi
done
) >/tmp/growthimage$$
# OK, now write the major-release labels
(
while read version size friends announce total days date
do
echo "set arrow from $days, $total - 55 to $days, $total - 15 head"
echo "set label '$version' at $days - 5, $total - 65"
done
) >/tmp/growthimage$$
cat >>/tmp/growthimage$$ <growth.png
rm -f /tmp/growth*
# growthplot ends here