Date: Fri, 9 Mar 2001 18:57:45 -0800 (PST) From: Gordon Tetlow <gordont@bluemtn.net> To: Gregory Sutter <gsutter@zer0.org> Cc: Josef Karthauser <joe@tao.org.uk>, j mckitrick <jcm@FreeBSD-uk.eu.org>, <freebsd-stable@FreeBSD.ORG> Subject: Re: cvs mailing list for RELENG_4 only? Message-ID: <Pine.BSF.4.33.0103091849180.498-100000@sdmail0.sd.bmarts.com> In-Reply-To: <20010309155019.J90153@klapaucius.zer0.org>
next in thread | previous in thread | raw e-mail | index | archive | help
I just tweaked out Greg's recipies for my own purposes. Here it is and the
accompanying helper script. It splits out all the RELENG_4 commits and all
the replies to those commits (based on Message-ID).
enjoy!
====
# add cvsweb urls to the bottom of each commit
# courtesy hoek@freebsd.org
PERLSCRIPT='
while (<>) {
if (/^\s+(\d+\.)+\d+\s+\+\d+ \-\d+\s+/) {
$r = $_;
$r =~+s/.*?([A-Za-z]+\/.+)/http\:\/\/www.FreeBSD.ORG\/cgi\/cvsweb\.cgi\/\1/;
$l = "$l$r";
}
print "$_";
}
print "$l";
'
FROM="((X-)?(((Envelope-)?Sender|(Apparently-|Resent-)?From)|Reply-To|Return-Path):(.*\<)?)"
# freebsd lists
BSDLISTS="(advocacy|announce|arch|chat|current|cvs-all|doc|emulation|hackers|hardware|ipfw|isp|jobs|mobile|mozilla|net|ports|ppc|qa|questions|security|small|smp|stable)"
# tag FreeBSD commit messages appropriately
:0 bf
* ^Sender:[ ]*owner-(freebsd-)?cvs-(all|committers)@FreeBSD.ORG
* ^Subject: cvs commit:
| perl -Te "${PERLSCRIPT}"
:0
* $ ^${FROM}freebsd.org
{
#:0 Wh : freebsd.lock
#| /usr/local/bin/formail -D 32768 $PMDIR/bsd.cache
:0 :
* ^Subject:[ ]*([Rr][Ee]:)* cvs commit: \/(doc|ports|www|CVSROOT)
bsd/cvs-$MATCH
:0
* ^Subject:[ ]*cvs commit:
* ^X-FreeBSD-CVS-Branch:[ ]*RELENG_4
{
# For everything that is commited for the stable branch, add
# it into a cache for later. This way, we can filter replies
# into the same folder.
# XXX I don't think I need the W here, but what the heck.
:0 Wc: freebsd.lock
| /usr/local/bin/formail -D 32768 $PMDIR/bsd.stable.cache
:0 :
bsd/cvs-stable
}
# This would be the filter that looks up the reference ids and filters
# accordingly. Returns 0 (success) and cats the message to stdout if
# it has a reference listed in the the cache file. Returns 1 (failure)
# if there is no reference id listed, falling through for later recipies
# to pick up.
:0 W: freebsd.lock
|/home/gordont/bin/reference.sh $PMDIR/bsd.stable.cache >> bsd/cvs-stable
:0 :
* $ ^Sender:[ ]*owner-(freebsd-)?\/$BSDLISTS
bsd/$MATCH
}
==== and reference.sh
#!/bin/sh
TMPFILE=/tmp/mail.$$.tmp
CACHEFILE=$1
touch $TMPFILE
chmod 600 $TMPFILE
cat > $TMPFILE
# XXX Better way to do this?
REFID=`egrep '(References:|In-Reply-To:)' $TMPFILE | cut -f 2 -d " " | grep "<" | head -1`
if [ "x$REFID" = "x" ]; then
# If there are no refereneces then we just error out and let
# procmail deliver elsewhere
rm $TMPFILE
exit 1;
fi
grep $REFID $CACHEFILE > /dev/null
if [ $? -eq 0 ]; then
# Add it to the cache.
# This way, replies to replies also get filtered.
/usr/local/bin/formail -D 32768 $CACHEFILE < $TMPFILE
cat $TMPFILE
rm $TMPFILE
exit 0;
fi
rm $TMPFILE
exit 1;
====
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.33.0103091849180.498-100000>
