From cf8ccd57811ebf789ddf93626b32f8689d9dc188 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 28 Apr 2001 20:38:24 +0000 Subject: [PATCH] Initial revision --- scripts/cvsuser/commit-source.sh | 35 ++++++++++++++++++++++++++++++++ scripts/cvsuser/commit-www.sh | 4 ++++ scripts/cvsuser/senddiff.pl | 30 +++++++++++++++++++++++++++ 3 files changed, 69 insertions(+) create mode 100755 scripts/cvsuser/commit-source.sh create mode 100755 scripts/cvsuser/commit-www.sh create mode 100755 scripts/cvsuser/senddiff.pl diff --git a/scripts/cvsuser/commit-source.sh b/scripts/cvsuser/commit-source.sh new file mode 100755 index 000000000..588f9cade --- /dev/null +++ b/scripts/cvsuser/commit-source.sh @@ -0,0 +1,35 @@ +#!/bin/sh +NOTIFY="eressea-design@eressea.kn-bremen.de" +#NOTIFY="enno@eressea.upb.de" +NEWFILE="/tmp/commit.source.$$" +OLDFILE="/tmp/commit.source.last" + +BUILDNO=0 +BUILDFILE="/home/cvs/.build/eressea-source" +if [ -e $BUILDFILE ]; then + BUILDNO=`cat $BUILDFILE` +fi + +perl -e '$i=0; while (<>) { if (/^Log Message.*$/) { $i=1; } else { if ($i==1) { print $_; } else { if (/^.*(Tag.*)$/) { print "$1\n\n"; } } } }' >| $NEWFILE +WHO="$1" +shift + +NEWMD5=`md5sum $NEWFILE | awk '{ print $1 }'` +echo "New md5sum=$NEWMD5" +if [ -e $OLDFILE ]; then + OLDMD5=`md5sum $OLDFILE | awk '{ print $1 }'` +else + OLDMD5="N/A" +fi +cp $NEWFILE $OLDFILE +echo "Old md5sum=$OLDMD5" +if [ $NEWMD5 != $OLDMD5 ]; then + let BUILDNO=$BUILDNO+1 + echo $BUILDNO >| $BUILDFILE + mailx -s "[commit $BUILDNO] eressea-source by $WHO" $NOTIFY < $NEWFILE + echo "New log message. Sent out notification" +else + echo "Identical log message. Notification skipped" +fi +echo $BUILDNO $@ | mailx -s "build eressea" cvs@eressea.upb.de +rm $NEWFILE diff --git a/scripts/cvsuser/commit-www.sh b/scripts/cvsuser/commit-www.sh new file mode 100755 index 000000000..49e8d1313 --- /dev/null +++ b/scripts/cvsuser/commit-www.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +# notify the web user of the change +mailx -s "update eressea" www-data@eressea.upb.de diff --git a/scripts/cvsuser/senddiff.pl b/scripts/cvsuser/senddiff.pl new file mode 100755 index 000000000..7380b9425 --- /dev/null +++ b/scripts/cvsuser/senddiff.pl @@ -0,0 +1,30 @@ +#!/usr/bin/perl + +require Mail::Send; + +if(scalar(@ARGV) == 0) { + exit(); +} + +$msg = new Mail::Send; +$msg->to('eressea-diff@eressea.upb.de'); + +# system('cvs update'); + +$no = shift(@ARGV); +$dir = shift(@ARGV); +($project, $dir) = split(/\//, $dir, 2); + +$msg->set('Subject', "[commit $no] diff $project/$dir"); +$mail = $msg->open(); + +print $mail "updated files in $project/$dir\n"; +chdir('/home/cvs/checkout/eressea/$project/$dir'); + +foreach $arg (@ARGV) { + ($file, $oldver, $newver) = split(/,/, $arg); + print $mail "COMMAND: cvs diff -u -r $oldver -r $newver $file\n\n"; + print $mail `cd /home/cvs/checkout/eressea/$project/$dir ; cvs diff -u -r $oldver -r $newver $file`; +} + +$mail->close();