diff --git a/tools/portsgrowth/getinfo.sh b/tools/portsgrowth/getinfo.sh index 0b62280aee..c154448bdf 100644 --- a/tools/portsgrowth/getinfo.sh +++ b/tools/portsgrowth/getinfo.sh @@ -1,25 +1,36 @@ -#! /bin/sh -e +#!/bin/sh -ex +# +# Refresh source file used for ploting ports growth status. +# +# Get an information about all revisions listed in 'cvs log' and merge +# it with our current list. This lets us keep info about revisions that +# have been axed from the repository during ports/INDEX cleanup. +# +# $FreeBSD$ -# Get a linecount for all the revisions listed in 'cvs log' and append -# to our current list. This lets us keep info for revisions that have -# been axed from the repository. -cvs log /usr/ports/INDEX | +CVSCMD='cvs -QR' +INDEX=ports/INDEX + +echo "*** Refreshing ports.log status" +cp ports.log ports.log1 + +$CVSCMD co $INDEX + +$CVSCMD log $INDEX | sed -ne "s/^date: \([^;]*\);.*$/\1/p" | while read date ; do - echo $date - cvs update -D "$date" /usr/ports/INDEX - echo $date $(wc -l < /usr/ports/INDEX) >> ports.log + grep "$date" ports.log > /dev/null 2>&1 + if [ $? = 1 ]; then + echo $date + $CVSCMD up -D "$date" $INDEX + echo $date $(wc -l < $INDEX) >> ports.log1 + fi done -# Put INDEX back the way we found it. -cvs update -A /usr/ports/INDEX # Remove dupes. -sort -u ports.log > ports.log1 -mv ports.log1 ports.log +sort -u ports.log1 > ports.log -# Generate graph. -gnuplot ports.plt +# Cleanup +rm ports.log1 +rm -r ports -# Interlace. -pngtopnm ports.png | pnmtopng -i > ports.png1 -mv ports.png1 ports.png