# freebsd.rc # procmail rules for dealing with freebsd mail # address@hidden # # $Id: freebsd.rc,v 1.7 2003/08/05 07:41:44 gsutter Exp gsutter $ # To use: # # (optional steps; route around them as desired) # - mkdir ~/.procmail # - mv ~/.procmailrc ~/.procmail/procmailrc && \ # ln -s ~/.procmail/procmailrc ~/.procmailrc # - Add PMDIR=$HOME/.procmail to the top of your procmailrc # - Edit lists ($BSDLISTS) and target folders to your specification. # # (necessary steps) # - Put freebsd.rc in your $PMDIR (set $PMDIR as necessary) # - INCLUDERC=freebsd.rc in your .procmailrc # FreeBSD Project commit mail REPOS=(CVSROOT|doc|ports|projects|src|www) # tag FreeBSD commit messages appropriately :0 * $ ^Sender:[ ]*owner-(freebsd-)?[a-z]+-(all|committers|${REPOS})@FreeBSD.ORG * ^Subject: cvs commit: { # tag with the correct portion of the tree :0 f * $ ^Subject: cvs commit: \/${REPOS} | formail -i "X-FreeBSD-CVS-Tree: $MATCH" # add PR and CVSweb urls to the bottom of each commit # courtesy address@hidden and address@hidden PERLSCRIPT=' while (<>) { if (/^\s+PR\:[^\d]+(\d+)/) { chomp; print "$_ http://www.FreeBSD.org/cgi/query-pr.cgi?pr=$1\n"; next; } if (/^\s+[\d\.]+\s+\+\d+\s+\-\d+\s+(.*)\s+\((dead|new)\)/) { $l .= "http\:\/\/cvsweb\.FreeBSD\.org\/$1\n"; } elsif (/^\s+([\d\.]+)\.(\d+)\s+\+\d+\s+\-\d+\s+(.*)/) { $l .= "http\:\/\/www\.FreeBSD\.org\/cgi\/cvsweb.cgi\/$3\.diff\?r1\=$1\." . ($2 - 1) . "\&r2\=$1\.$2\n"; } print; } print "$l\n" if ($l); ' :0 bf | perl -Te "${PERLSCRIPT}" }