1 |
|
#!/bin/sh |
2 |
|
|
3 |
– |
#--------------------------------------------------------- |
4 |
– |
# cvslog.sh |
5 |
– |
# |
6 |
– |
# Script to send daily cvslog e-mails. |
7 |
– |
# Written by Tim Bishop [tdb1@ukc.ac.uk] 26/01/2001 |
8 |
– |
# |
9 |
– |
# Copyright i-Scream, 2000 |
10 |
– |
# http://www.i-scream.org.uk |
11 |
– |
#--------------------------------------------------------- |
12 |
– |
|
3 |
|
## settings |
4 |
|
|
5 |
< |
# destination address |
6 |
< |
ADDRESS="dev@i-scream.org.uk" |
5 |
> |
# e-mail addresses |
6 |
> |
TOADDR="commits@i-scream.org" |
7 |
> |
FROMADDR="commits@i-scream.org" |
8 |
|
|
9 |
|
# cvs path |
10 |
< |
CVS="/home/cut/tdb1/bin/cvs" |
10 |
> |
CVS="/usr/bin/cvs" |
11 |
|
|
12 |
|
# cvs repository |
13 |
< |
CVSROOT="/usr/local/proj/co600_10/cvs" |
13 |
> |
CVSROOT="/cvs/i-scream" |
14 |
|
|
15 |
|
# temporary checkout directory (checked out modules already) |
16 |
< |
CHECKOUTDIR="/home/cut/tdb1/cvsscripttemp" |
16 |
> |
CHECKOUTDIR="/tmp/i-scream/cvstmp" |
17 |
|
|
18 |
|
# path to cvs2cl |
19 |
< |
CVS2CLPATH="/home/cut/tdb1/bin/cvs2cl" |
19 |
> |
CVS2CLPATH="/usr/local/bin/cvs2cl" |
20 |
|
|
21 |
|
# command line args for cvs2cl |
22 |
< |
CVS2CLARGS="-w -r -b -t -U ${CVSROOT}/CVSROOT/users -l \"-dyesterday<today\" -g \"-d/usr/local/proj/co600_10/cvs\" -g \"-Q\"" |
22 |
> |
CVS2CLARGS="--no-wrap --no-common-dir -w -r -t -S -U ${CVSROOT}/CVSROOT/users -l -dyesterday<today -g -d${CVSROOT} -g -Q" |
23 |
|
|
24 |
|
# cvs2cl command |
25 |
|
CVS2CL="${CVS2CLPATH} ${CVS2CLARGS}" |
27 |
|
# subject line |
28 |
|
SUBJECT="i-scream daily commit logs - " |
29 |
|
|
30 |
+ |
# full cvs update script |
31 |
+ |
FULLCVSUPDATE="/home/iscream/bin/fullcvsupdate.sh" |
32 |
|
|
33 |
+ |
# path to sendmail |
34 |
+ |
SENDMAIL="/usr/sbin/sendmail" |
35 |
+ |
|
36 |
+ |
# cvslog webpage for this day :) |
37 |
+ |
DATE=`/bin/date -v-1d +%Y/%m/%d` |
38 |
+ |
CVSLOGURL="http://www.i-scream.org/cgi-bin/cvslog.cgi?period=date&date=${DATE}&module=" |
39 |
+ |
CVSLOGLINE="This log is viewable online at ${CVSLOGURL}" |
40 |
+ |
|
41 |
|
## code |
42 |
|
|
43 |
< |
cd ${CHECKOUTDIR} |
43 |
< |
${CVS} -d ${CVSROOT} -Q update -d |
43 |
> |
${FULLCVSUPDATE} >/dev/null 2>&1 |
44 |
|
|
45 |
< |
MODULES="CVSROOT documentation experimental misc source web" |
45 |
> |
MODULES=`ls ${CVSROOT}` |
46 |
|
|
47 |
< |
for MOD in ${MODULES}; do |
47 |
> |
cd ${CHECKOUTDIR} |
48 |
|
|
49 |
< |
${CVS2CL} ${MOD} |
49 |
> |
for MODULE in ${MODULES}; do |
50 |
> |
|
51 |
> |
${CVS2CL} ${MODULE} |
52 |
|
if test -r "ChangeLog"; then \ |
53 |
< |
cat ChangeLog | mailx -s "${SUBJECT}${MOD}" ${ADDRESS}; \ |
53 |
> |
( echo "To: ${TOADDR}"; echo "From: ${FROMADDR}"; \ |
54 |
> |
echo "Subject: ${SUBJECT}${MODULE}"; echo ${CVSLOGLINE}${MODULE}; \ |
55 |
> |
echo; echo; cat ChangeLog; \ |
56 |
> |
echo "." ) | ${SENDMAIL} ${TOADDR}; \ |
57 |
|
rm -f ChangeLog |
58 |
|
fi; |
59 |
|
|