forked from github/server
Initial revision
This commit is contained in:
parent
a9efe2898e
commit
cf8ccd5781
|
@ -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
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
|
||||
# notify the web user of the change
|
||||
mailx -s "update eressea" www-data@eressea.upb.de
|
|
@ -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();
|
Loading…
Reference in New Issue