alliance/CVSROOT/postconfig

90 lines
1.8 KiB
Bash
Executable File

#!/bin/sh
#
# Filename: postconfig
# Copyright (C) 1999, 2000 Czo <Olivier.Sirol@lip6.fr>
# License: GPL (http://www.gnu.org/copyleft/gpl.html)
# Started: Sept 1999
# Last Change: Thursday 24 October 2002, 12:04
# Edit Time: 1:37:07
# Description:
#
# $Id: postconfig,v 1.57 2002/10/24 10:04:51 czo Exp $
#
TMPFILE=cvslog.$$
FINGER=`who am i | gawk '{gsub(/^[^\!]*\!/,""); print $1}'`
(
echo "==================================================================="
echo "Modification le : `date`"
echo "Par : $USER"
echo "==================================================================="
echo ""
cat
) > "$TMPFILE"
cat "$TMPFILE" >> $CVSROOT/CVSROOT/log-commit
UPDATE_DIR=`cat "$TMPFILE" | gawk '
/^Update of .*\/cvsroot\// {
gsub(/^Update of .*\/cvsroot\//, "");
SUJ=$0
}
END {
printf("%s", SUJ)
}'`
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 "$UPDATE_DIR" | sed 's§alliance/§§' | sed 's§share/§§' | sed 's§sources/§§'`
(
# echo $UPDATE_DIR >> "$TMPFILE"
# echo $UPDATE_IN >> "$TMPFILE"
# echo $MAIL_SUBJECT >> "$TMPFILE"
# echo $MODIFIED_FILES >> "$TMPFILE"
# pwd
(
echo ""
echo "==================================================================="
echo ""
cd $UPDATE_IN
sleep 15
cvs diff -kk -l -D "5 min ago" $MODIFIED_FILES | head -50
) >> "$TMPFILE"
# pwd
# cat $TMPFILE
cat "$TMPFILE" | mail -s "$MAIL_SUBJECT" alliance-cvs@asim.lip6.fr
# find cvsroot -type d | xargs chmod g+s
# devrait marcher...
# chgrp -R alliance /users/outil/alliance/cvsroot
# cvs -q update -d -P & en crontab ....
rm -f "$TMPFILE" dummy
) > /dev/null 2>&1 &
exit 0