51 lines
1.5 KiB
Bash
Executable File
51 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
module=`echo $1 | cut -d/ -f1`
|
|
message=`cat`
|
|
uname=`id -un`
|
|
lineno=`echo "$message" | grep -n "Log Message:" | awk -F: ' { print $1 } '`
|
|
message=`echo "$message" | sed "1,${lineno}d"`
|
|
|
|
projectname="zsnes"
|
|
tmpfile="/tmp/$RANDOM-$projectname"
|
|
message=`echo "$message" | head -n 5`
|
|
#message=`echo $message | tr '\n\r' ' '`
|
|
|
|
cat <<EOF >$tmpfile
|
|
From: pagefault@users.sourceforge.net
|
|
To: commits@picogui.org
|
|
Content-Type: text/plain;
|
|
Subject: Announce $projectname
|
|
|
|
commit to module {green}$module{normal} by {orange}$uname{normal}: $message
|
|
EOF
|
|
|
|
|
|
if [ -e /tmp/lastlog-$projectname ]; then
|
|
if ! diff /tmp/lastlog-$projectname $tmpfile &>/dev/null; then
|
|
# there are differences, so this is a different commit
|
|
cat $tmpfile | /usr/sbin/sendmail -t
|
|
mv $tmpfile /tmp/lastlog-$projectname
|
|
else
|
|
# it's just cvs spamming us from another directory
|
|
rm $tmpfile
|
|
fi
|
|
else
|
|
cat $tmpfile | /usr/sbin/sendmail -t
|
|
mv $tmpfile /tmp/lastlog-$projectname
|
|
fi
|
|
|
|
if [ -e /tmp/lastlog-$projectname ]; then
|
|
if ! diff /tmp/lastloga-$projectname $tmpfilea &>/dev/null; then
|
|
# there are differences, so this is a different commit
|
|
cat $tmpfilea | /usr/sbin/sendmail -t
|
|
mv $tmpfilea /tmp/lastloga-$projectname
|
|
else
|
|
# it's just cvs spamming us from another directory
|
|
rm $tmpfilea
|
|
fi
|
|
else
|
|
cat $tmpfilea | /usr/sbin/sendmail -t
|
|
mv $tmpfilea /tmp/lastloga-$projectname
|
|
fi
|
|
|