From: Rob H. <for...@us...> - 2003-03-04 07:19:49
|
Update of /cvsroot/sandweb/sandweb/bin In directory sc8-pr-cvs1:/tmp/cvs-serv8043/bin Added Files: sandweb-editor Log Message: ah, another standalone binary that SandWeb depends on :) This is a shell script that acts as CVSEDITOR. So, instead of dealing with the security nightmare of passing the commit message on the command line (cvs commit -m "$message"), now we can just (CVSEDITOR=/usr/bin/sandweb-editor && export CVSEDITOR ) first, and write the commit message to $sandweb_dir/commitmsg This is very similar to the way we pass the VCS password to sandweb-expect (that's where I got the inspiration from). --- NEW FILE --- #!/bin/sh # # This file pretends to be an editor so we can safely pass any characters # we want as part of a CVS checkin command. # # Copyright 2003 Rob Helmer <ro...@ro...> # Made for the SandWeb project - http://sandweb.sf.net # We need EDITED_FILE to be defined already! EDITED_FILE=$1 NOTE="Note: MESSAGE_FILE must already be defined! " SYNTAX="Syntax: $0 <file with commit message>" if test -z $MESSAGE_FILE; then # tell the user how to use this script echo $NOTE echo $SYNTAX # exit abnormally exit 10 fi if test -z $EDITED_FILE; then # tell the user how to use this script echo $NOTE echo $SYNTAX # exit abnormally exit 2 fi # CVS doesn't like it if we don't take a second to return, not # sure why. sleep 1 # Here's the main action of this script - cat the file containing the # message into the file CVS will look for the commit message. cat $MESSAGE_FILE > $EDITED_FILE # Exit normally, CVS looks for this (like a Unix program should) exit 0 |