#!/usr/bin/bash # script to automate cpantesting. needs WWW::Mechanize to be installed. # get all links on the search.cpan.org recent uploads page. # output to a file called current. mech-dump --links --absolute http://search.cpan.org/recent | grep "~" | ggrep -v -f $HOME/cpantesting/config/badmodules > $HOME/cpantesting/history/current # diff against a file called previous to get new modules NEWMOD=`diff $HOME/cpantesting/history/previous $HOME/cpantesting/history/current | grep ">" | awk '{print $2}'` NUMBER=`echo $NEWMOD | wc -w` STARTDATE=`date` echo "testing $NUMBER modules" echo "testing $NUMBER modules $STARTDATE" >> $HOME/cpantesting/history/autolog echo "testing $NEWMOD" >> $HOME/cpantesting/history/autolog for modules in $NEWMOD do echo $modules TARBALL=`mech-dump --links --absolute $modules |ggrep -e gz -e zip -e bz2 -m 1` # run my cpantest script with ~/bin/cpantest.sh $TARBALL done ENDDATE=`date` echo "tested $NUMBER modules $ENDDATE" >> $HOME/cpantesting/history/autolog mv $HOME/cpantesting/history/current $HOME/cpantesting/history/previous