info-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Commitinfo Script Error Message


From: Aaron Bono
Subject: Commitinfo Script Error Message
Date: Tue, 29 Aug 2006 13:35:36 -0500

I have written a script called grant-access.sh which goes through a text file that contains a list of users and allows a commit if the user is in the file and denies the access if they are not.  Here is the script:

-------------------------------------------------------

#!/bin/sh
listFile=$1
list=`cat ${CVSROOT}/CVSROOT/${listFile}`

for user in $list
do
    if [ "${CVS_USER}" = "${user}" ];
    then
        exit 0;
    fi
done
echo "User ${CVS_USER} is not allowed to commit to this resource"
exit 1;

-------------------------------------------------------

The script works but if the user is denied, the message from the echo does not get sent back to the user.  Instead, the user gets the error:

-------------------------------------------------------

The server reported an error while performing the "cvs commit" command.
  MyProject: cvs commit: warning: commitinfo line contains no format strings:
  MyProject:     "/var/lib/cvs/myrepository/CVSROOT/grant- access.sh admin-list.txt"
  MyProject: Appending defaults (" %r/%p %s"), but please be aware that this usage is
  MyProject: deprecated.
  MyProject: cvs commit: Pre-commit check failed
  MyProject: cvs [commit aborted]: correct above errors first!

--------------------------------------------------------

This error is not very informative to the user.  Is there a way have the grant-access.sh script generate a message that CVS sends back to the user?

Thanks!

==================================================================
   Aaron Bono
   Aranya Software Technologies, Inc.
   http://www.aranya.com
   http://codeelixir.com
==================================================================
reply via email to

[Prev in Thread] Current Thread [Next in Thread]