2000-09-07 02:06:01 -05:00
|
|
|
|
#!/bin/sh
|
1999-09-16 13:13:15 -05:00
|
|
|
|
#
|
2000-09-07 02:06:01 -05:00
|
|
|
|
# Filename: postconfig
|
|
|
|
|
# Copyright (C) 1999, 2000 Czo <Olivier.Sirol@lip6.fr>
|
|
|
|
|
# License: GPL (http://www.gnu.org/copyleft/gpl.html)
|
|
|
|
|
# Started: Sept 1999
|
2002-02-12 09:34:22 -06:00
|
|
|
|
# Last Change: Tuesday 12 February 2002, 16:29
|
|
|
|
|
# Edit Time: 1:34:49
|
2000-09-07 02:06:01 -05:00
|
|
|
|
# Description:
|
1999-09-16 13:13:15 -05:00
|
|
|
|
#
|
2002-02-12 09:34:22 -06:00
|
|
|
|
# $Id: postconfig,v 1.55 2002/02/12 15:34:22 czo Exp $
|
1999-09-16 13:13:15 -05:00
|
|
|
|
#
|
1999-09-14 13:15:22 -05:00
|
|
|
|
|
2000-09-07 04:14:51 -05:00
|
|
|
|
TMPFILE=cvslog.$$
|
1999-11-04 07:36:59 -06:00
|
|
|
|
FINGER=`who am i | gawk '{gsub(/^[^\!]*\!/,""); print $1}'`
|
2000-09-07 04:12:12 -05:00
|
|
|
|
|
1999-09-16 13:07:59 -05:00
|
|
|
|
(
|
2000-09-07 09:08:20 -05:00
|
|
|
|
echo "==================================================================="
|
1999-09-16 13:07:59 -05:00
|
|
|
|
echo "Modification le : `date`"
|
2000-06-15 05:21:56 -05:00
|
|
|
|
echo "Par : $USER"
|
2000-09-07 09:08:20 -05:00
|
|
|
|
echo "==================================================================="
|
1999-09-16 13:07:59 -05:00
|
|
|
|
echo ""
|
|
|
|
|
cat
|
2000-09-07 09:08:20 -05:00
|
|
|
|
) > "$TMPFILE"
|
|
|
|
|
|
|
|
|
|
cat "$TMPFILE" >> $CVSROOT/CVSROOT/log-commit
|
1999-09-14 13:15:22 -05:00
|
|
|
|
|
2000-09-07 01:59:45 -05:00
|
|
|
|
UPDATE_DIR=`cat "$TMPFILE" | gawk '
|
2000-09-07 09:08:20 -05:00
|
|
|
|
/^Update of .*\/cvsroot\// {
|
|
|
|
|
gsub(/^Update of .*\/cvsroot\//, "");
|
1999-09-21 10:58:38 -05:00
|
|
|
|
SUJ=$0
|
|
|
|
|
}
|
|
|
|
|
END {
|
2000-09-07 01:59:45 -05:00
|
|
|
|
printf("%s", SUJ)
|
1999-09-21 10:58:38 -05:00
|
|
|
|
}'`
|
|
|
|
|
|
2000-09-07 01:59:45 -05:00
|
|
|
|
UPDATE_IN=`cat "$TMPFILE" | gawk '
|
|
|
|
|
/^In directory / {
|
|
|
|
|
gsub(/^In directory [^:]*:/, "");
|
|
|
|
|
SUJ=$0
|
|
|
|
|
}
|
|
|
|
|
END {
|
|
|
|
|
printf("%s", SUJ)
|
|
|
|
|
}'`
|
|
|
|
|
|
|
|
|
|
MODIFIED_FILES=`cat "$TMPFILE" | gawk '
|
|
|
|
|
/^Modified Files:/ { start=1; next}
|
|
|
|
|
/^Log Message:/ { start=0; }
|
|
|
|
|
{if (start) MFILES=MFILES " " $0 ;}
|
|
|
|
|
END {
|
|
|
|
|
printf("%s", MFILES)
|
|
|
|
|
}'`
|
|
|
|
|
|
|
|
|
|
MAIL_SUBJECT=`echo "CVS loginfo, $UPDATE_DIR" | sed 's<>alliance/<2F><>' | sed 's<>share/<2F><>' | sed 's<>sources/<2F><>'`
|
|
|
|
|
|
2000-09-07 09:08:20 -05:00
|
|
|
|
(
|
|
|
|
|
# echo $UPDATE_DIR >> "$TMPFILE"
|
|
|
|
|
# echo $UPDATE_IN >> "$TMPFILE"
|
|
|
|
|
# echo $MAIL_SUBJECT >> "$TMPFILE"
|
|
|
|
|
# echo $MODIFIED_FILES >> "$TMPFILE"
|
2000-09-07 01:59:45 -05:00
|
|
|
|
|
|
|
|
|
|
2000-09-07 04:01:50 -05:00
|
|
|
|
# pwd
|
2000-09-07 09:08:20 -05:00
|
|
|
|
(
|
|
|
|
|
echo ""
|
|
|
|
|
echo "==================================================================="
|
|
|
|
|
echo ""
|
2000-09-07 03:11:05 -05:00
|
|
|
|
|
2000-09-07 09:08:20 -05:00
|
|
|
|
cd $UPDATE_IN
|
|
|
|
|
sleep 15
|
2000-09-07 09:31:37 -05:00
|
|
|
|
cvs diff -kk -l -D "5 min ago" $MODIFIED_FILES | head -50
|
2000-09-07 09:08:20 -05:00
|
|
|
|
) >> "$TMPFILE"
|
|
|
|
|
# pwd
|
2000-09-07 03:11:05 -05:00
|
|
|
|
|
2000-09-07 02:03:28 -05:00
|
|
|
|
# cat $TMPFILE
|
2000-09-07 01:59:45 -05:00
|
|
|
|
|
2000-09-07 02:03:28 -05:00
|
|
|
|
cat "$TMPFILE" | mail -s "ALC : $MAIL_SUBJECT" alliance-programmers@asim.lip6.fr
|
1999-09-17 12:42:17 -05:00
|
|
|
|
|
1999-09-17 12:47:08 -05:00
|
|
|
|
# find cvsroot -type d | xargs chmod g+s
|
|
|
|
|
# devrait marcher...
|
2000-06-15 05:17:22 -05:00
|
|
|
|
# chgrp -R alliance /users/outil/alliance/cvsroot
|
1999-09-24 07:10:43 -05:00
|
|
|
|
# cvs -q update -d -P & en crontab ....
|
1999-09-16 13:07:59 -05:00
|
|
|
|
|
|
|
|
|
rm -f "$TMPFILE" dummy
|
2000-09-07 09:08:20 -05:00
|
|
|
|
) > /dev/null 2>&1 &
|
1999-09-14 13:15:22 -05:00
|
|
|
|
|
1999-09-16 13:07:59 -05:00
|
|
|
|
exit 0
|
1999-09-14 13:15:22 -05:00
|
|
|
|
|
2000-09-07 09:08:20 -05:00
|
|
|
|
|