Section 6.2. Logging In


6.2. Logging In

You use the cvspass task to log into a CVS server to get access to the code stored in the CVS repository. This task adds entries to a .cvspass file, which has the same affect as a CVS login command. When a .cvspass file has been created, subsequent logins will get the needed data from this file, and you won't have to supply a password again.

The values you assign to the attribute named cvsroot use the same format of strings that appear in a CVS .cvspass file, which specifies the protocol type, username, server, and repository location. For example, using the pserver protocol with a user named Steven, a server named STEVE, and a repository location of /home/steven/repository, cvspass would look like:

<?xml version="1.0"?> <project default="main" basedir=".">     <property name="cvs.dir" value="project" />     <target name="main" >         <cvspass cvsroot=":pserver:steven@STEVE:/home/steven/repository"             password="opensesame" />         .         .         .     </target> </project>

The CVS-related tasks can read the CVS root value from the cvsroot attribute, if they support that attribute, or from the CVSROOT environment variable.

In Windows, when your username includes a space or spaces, you might run into problems with the cvsroot attribute. In that case, assign a value to the CVSROOT environment variable instead (e.g., C:\ant\ch06>set CVSROOT=:pserver:Steven Holzner@STEVE:/home/steven/repository) and then use cvspass or other CVS-related tasks in your build file normally.


The attributes of the cvspass task appear in Table 6-3.

Table 6-3. Attributes for the cvspass task

Attribute

Description

Required

Default

cvsroot

Specifies the CVS repository you want to add an entry for

Yes

 

passfile

Specifies the password file you want to add the entry to

No

~/.cvspass

password

Specifies the password you want to be added to the password file

Yes

 




    Ant. The Definitive Guide
    Ant: The Definitive Guide, 2nd Edition
    ISBN: 0596006098
    EAN: 2147483647
    Year: 2003
    Pages: 115
    Authors: Steve Holzner

    Similar book on Amazon

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net