#!/bin/bash # solar and ferringb - Mar 13 2007 TOPDIR=/var/www/archives.gentoo.org cd ${TOPDIR} if [[ $1 == "" ]]; then lists="$( List Archives solar ferringb ${2}ly Stats of the Gentoo Linux mailing list ${1}. 1.0
${2}ly stats for ${1}
    EOF # flush the stdin to stdout cat cat <
EOF } for x in $lists; do [[ -d ${TOPDIR}/.maildir/.${x} ]] || continue echo "Generating stats for $x" base="${TOPDIR}/htdocs/stats/" if ! python ${TOPDIR}/script.py ${TOPDIR}/.maildir/.${x} ${TOPDIR}/stats.address-mangling --guidexml --reversed \ --year "$base/${x}-per-year.xml~" \ --month "$base/${x}-per-month.xml~"; then echo "crap, failed $x" rm -f "${base}/${x}"-per-{year,month}.xml~ else for y in year month; do wrap_output "$x" $y < "$base/${x}-per-${y}.xml~" | \ sed -e 's/@gentoo\.org//g' -e 's/@/ () /g' > "${base}/${x}-per-${y}.xml" rm "${base}/${x}-per-${y}.xml~" done fi done # make the index.xml page. #echo "Generating final index.xml" cd ${TOPDIR}/htdocs/stats || exit 1 cat < index.xml List Archives solar User Stats of the Gentoo Linux mailing lists. 1.0
List Archives Stats
    EOF for x in $(find . -name '*.xml' | cut -c 3- | grep -v index.xml | sort -u | grep per); do name=$(basename $x .xml) echo "
  • ${name}
  • " >> index.xml done cat <> index.xml
EOF