[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

r10401 - /man-cgi/extractor/count-manpages-archive.sh



Author: jfs
Date: Wed May 21 21:02:14 2014
New Revision: 10401

URL: http://svn.debian.org/wsvn/?sc=1&rev=10401
Log:
Modify the counting script to generate both a pretty report and a stats file, for comparison. The stats file is rotated every time it is run, which helps when run through cron

Modified:
    man-cgi/extractor/count-manpages-archive.sh

Modified: man-cgi/extractor/count-manpages-archive.sh
URL: http://svn.debian.org/wsvn/man-cgi/extractor/count-manpages-archive.sh?rev=10401&op=diff
==============================================================================
--- man-cgi/extractor/count-manpages-archive.sh	(original)
+++ man-cgi/extractor/count-manpages-archive.sh	Wed May 21 21:02:14 2014
@@ -10,11 +10,20 @@
 
 . ${MYDIR}/config
 
+[ ! -e ${EXTRACTORDIR}/data/ ] && mkdir -p ${EXTRACTORDIR}/data/
+# Rotate stats file
+savelog -m 640 -c 7  ${EXTRACTORDIR}/data/stats 
+# Create a new stats file
+> ${EXTRACTORDIR}/data/stats
+
+# Go through all distributions
 for i in ${EXTRACTORDIR}/manpages-dists/* ; do
 	if [ -d "$i" ] ; then 
 		distribution=`basename $i`
 		MANPAGES=`find $i  -type l -a \( -path "*/usr/share/man*" -o -path "*/usr/X11R6/man*" \) -a -name "*.gz" | wc -l `
 		echo "$MANPAGES manpages in release $distribution"
+# Add to stats files
+		[ -e "${EXTRACTORDIR}/data/stats" ] && echo "$distribution $MANPAGES" >>${EXTRACTORDIR}/data/stats
 	fi
 done
 


Reply to: