On Wednesday, March 15, 2000 3:18 AM, Mikael Grave 
[SMTP:[EMAIL PROTECTED]] wrote:
> Hello,
>
> I am currently writing a small Shell script that will log into my CVS
> respository and will issue a checkout. This script is intended to be
> called every 10mn by a crontab.
>
> Since "cvs login" does not have a command line option to pass the
> password, I was wondering if there is a simple trick to run "cvs login"
> automatically? I have tried things like:
>
> echo "xxxxx" | cvs login
>
> But it does not work (the password is not taken from the buffered stdin
> I guess).
>

You only need to login once.  After that the password is stored in a 
lightly encrypted format in your home directory.  So if you do a manual 
login, you shouldn't have to worry about it again.

> My original purpose was to perform an automatic checkout (in a test bed)
> every time someone was doing a commit. Doing this with "commitinfo" did
> not seem possible since "cvs commit" recursively commit all modified
> files, if 100 files are commited at once, I don't want commitinfo to
> launch 100 checkouts (maybe should I simply run one "update" per
> "committed" file?). So I decided to go for a crontab (not as good, user
> may have to wait 10mn to see their changes published in the test bed).
>
> Any help or trick are welcome. I guess my problem is quite common. Hope
> my questions are not too stupid :)
>
Well, the other way to do things, as described in cederqvist, is to use 
loginfo, not commitinfo.

loginfo only runs after the commit succeeds and cederqvist gives an example 
of how to use it for an automated checkout.  In our loginfo file we have 
the following line to do this (excuse any mailer wrapping, this should be 
on one line):

WWW/* ($CVSROOT/CVSROOT/cvslog.sh ${USER} ALL %{};(cd /WWW ; sleep 5; echo 
`pwd` Updated by ${USER}-`date` ; /usr/local/bin/cvs -nq update -d ;echo 
--------------------- ; /usr/local/bin/cvs -q update -d ;echo 
=================================)>>$CVSROOT/CVSROOT/LOGS/WWW_update.log 
2>&1 &)

***************************************************************
Chris Cameron                    Open Telecommunications NZ Ltd
Software Development Team Leader
[EMAIL PROTECTED]                           P.O.Box 10-388
      +64 4 495 8403 (DDI)                          The Terrace
fax:  +64 4 495 8419                                 Wellington
cell: +64 21 650 680                                New Zealand
Life, don't talk to me about life ....(Marvin - HHGTTG)

Reply via email to