gnu.cvs.help
[Top] [All Lists]

RE: Needs CVS email notification help !

Subject: RE: Needs CVS email notification help !
From: "Bulgrien, Kevin"
Date: Tue, 4 Apr 2006 10:34:57 -0500
Newsgroups: gnu.cvs.help
-----Edited Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf
Of [email protected]
Sent: Monday, April 03, 2006 7:58 PM
To: [email protected]
Subject: Needs CVS email notification help !

Regarding loginfo. We do have cvs-log in our loginfo. But this is more for
searching ^module and trigger email script for notify. That part is working
for us, but our modules has a very deep directory structure.

So my question is: how can I have a trigger email notify for a specific
directory under out main modules when our users commit a checkin.
-----Edited Original Message-----

The loginfo trigger was very hard for me to get going based on lack of
documentation (at least in the non-development RPM I use).  Also, I
am using 1.11.xx and not 1.12.xx, but the following may be helpful to
you.  For any script to work, it is going to be very important to know
the API that the loginfo caller uses.

Here is a sample working loginfo bash script.  Hopefully it may provide
some insight.  I have not included the called scripts, but this should
give at least a minimal working interface that can be modified per your
requirements.  I called subscripts so that my loginfo trigger script is
common even though different sub-functions might run per repository
setup.

#!/bin/bash
#
# postcommit.sh
# 2005/10/05
#
# CVSROOT loginfo should contain:
#   ALL /home/cvs/scripts/postcommit.sh %{sVv}
#
# This creates the following script parameter format:
#   module file1,oldversion,newversion file2,oldversion,newversion ...
#
# The script will run as the user doing the commit.

EXE=/home/cvs/scripts
LOG=/home/cvs/logs

LST="${*#* }"
DIR="${*//% ${LST}/}"
D_T=$(date "+%m/%d/%y %H:%M:%S")

# Script API
#
# -l "log directory"
# -t "Date time"
# -d "module directory" (Could be null if top-level directory)
#
# ${LST} parameters are now a list of files with revision information:
#   file1,orev,rev file2,orev,rev ...
#
# If ${LST} begins with "-", the parameters are simply a text message.  For
# example:
#   - New Directory
#
# Subordinate scripts must handle exception cases where the first parameter
# is a "-".
#
# The following variables are defined by CVS and available for use:
#   CVSROOT   -
#   CVSEDITOR -
#   EDITOR    -
#   VISUAL    -
#   USER      - not necessarily the same as $(whoami)
#
# ${EXE}/debuginfo.sh -l "${LOG}" -t "${D_T}" -d "${DIR}" ${LST}
#
${EXE}/commitlog.sh -l "${LOG}" -t "${D_T}" -d "${DIR}" ${LST}
${EXE}/postchmod.sh -l "${LOG}" -t "${D_T}" -d "${DIR}" ${LST}

# Consume unanticipated extra input to avoid possible errors like:
#   cvs [commit aborted]: received broken pipe signal
#
cat > /dev/null




<Prev in Thread] Current Thread [Next in Thread>