[Popcon-commits] cvs commit to popularity-contest by pere

pere at cvs.alioth.debian.org pere at cvs.alioth.debian.org
Sat Jul 23 23:25:10 UTC 2005


Update of /cvsroot/popcon/popularity-contest
In directory haydn:/tmp/cvs-serv697

Modified Files:
	popcon-process.sh 
Log Message:
Make email processing optional.


Index: popcon-process.sh
===================================================================
RCS file: /cvsroot/popcon/popularity-contest/popcon-process.sh,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- popcon-process.sh	23 Jul 2005 23:09:02 -0000	1.15
+++ popcon-process.sh	23 Jul 2005 23:25:08 -0000	1.16
@@ -8,23 +8,31 @@
 DATADIR=$BASEDIR/popcon-entries
 SUMMARYDIR=$BASEDIR/all-popcon-results
 
+# set to 'true' if email submissions should be processed
+READMAIL=true
+
 # Remove entries older than # number of days
 DAYLIMIT=20
 
 set -e
 cd $BASEDIR
 umask 0002
-# rotate files
-mv $MAILDIR/survey new-popcon-entries
-touch $MAILDIR/survey
-chmod go-rwx $MAILDIR/survey
 
-# process entries
-$BINDIR/prepop.pl <new-popcon-entries >$LOGDIR/prepop.out 2>&1
+# rotate incoming mail spool files
+if [ true = "$READMAIL" ] ; then
+    mv $MAILDIR/survey new-popcon-entries
+    touch $MAILDIR/survey
+    chmod go-rwx $MAILDIR/survey
+
+    # process entries, splitting them into individual reports
+    $BINDIR/prepop.pl <new-popcon-entries >$LOGDIR/prepop.out 2>&1
+fi
 
 # delete outdated entries
 rm -f results
 find $DATADIR -type f -mtime +$DAYLIMIT -print0 | xargs -0 rm -f --
+
+# Generate statistics
 find $DATADIR -type f | xargs cat \
         | nice -15 $BINDIR/popanal.py >$LOGDIR/popanal.out 2>&1
 cp results $WEBDIR/all-popcon-results.txt




More information about the Popcon-commits mailing list