Cvs

From LocalizationWiki

CVS Server Setup

1. Install CVS, should be installed by default on many GNU/Linux distros.

  In Debian Linux -- using etch repository -- $apt-get install cvs

2. Creat a repository on your system. Lets say we want the repository to be /cvsroot directory

  $cvs -d /CVS init

3. Add a Unix group "cvs" to your system. Any user who need to access the repository should be in this group.

4. Make the repository's group ownership and permission reflect this group

  $cd /CVS
  $chgrp -R cvs .
  $chmod ug+rwx . CVSROOT

5. To enable the repository to be accessed across the network:

  As root, edit /etc/inetd.conf to add the following (all on ONE line):
  cvspserver stream tcp nowait root /usr/bin/cvs cvs --allow-root=/CVS pserver
  As root, edit /etc/services to confirm or add the following:
  cvspserver     2401/tcp     # CVS remote server function
  As root, issue the command
  $killall -HUP inetd

Putting a new project in the CVS repository

Putting a new project in the CVS repository is called importing a new module.

Say we have a new project in the directory my_proj to be imported into the CVS.

 Go to the top level directory of my_proj -- $cd my_proj
 Import the project -- $cvs -d /CVS import -m <log_message> <prog_name> <vendor_tag> <release_tag>
 Where proj_name is the name of the project. For most cases, you will not need to know about vendor_tag
 and release_tag. CVS requires them to be present, but you can simply use the name of the module as the 
 vendor_tag, and the current version as the release_tag.
 Once the module is imported, we have to make the modules group ownership and permission reflect the group (named cvs).
   $cd /CVS
   $chgrp -R cvs .
   $chmod ug+rwx . CVSROOT
 We have to run the above two commands to change the group ownership and permission everytime a new module ip uploaded into the repo.
 -d option is used to tell CVS where the repository is. If we set the env variable CVSROOT to /CVS
 i.e. $export CVSROOT=/CVS, we dont have to give the "-d /CVS" option.


Checking out a module, commiting files and adding new files/directories in a module

1. Checking out a module

   cvs -d <CVS_REPO_PATH> login where <CVS_REPO_PATH> is the path to the main CVS repo in the CVS server.
   For the DzongkhaLocalization project, we have the cvs server setup on the machine with ip = 192.168.0.123. and the repo is 
   located at "/CVS" and we use the :pserver method.
   Hence to checkout a module cvs -d :pserver:translator@192.168.0.123:/CVS login. This command will ask for a password and 
   the password is "password" (without the quotes). The cvs login command is needed only once for a particular machine.
   Afterwards all the modules can be checked-out by the checkout command.
   cvs -d :pserver:translator@192.168.0.123:/CVS co <module_name> where co = checkout and <module_name> = name of the module
   to checkout.
   -d option is used to tell CVS where the repository is. If we set the env variable CVSROOT to /CVS
   i.e. $export CVSROOT=:pserver:translator@192.168.0.123:/CVS, we dont have to give the "-d " option. Then we can just do
   cvs co <module_name>.

2. Commiting files

   To commit file : cvs ci <file_to_commit>. where ci is commit in short form.

3. Adding new files/directories.

   First creat/download the file/folder to be added.
   Then cvs add <file_name> or cvs add <dir_name>. Adding a directory doesnt add the files in it. We have to go into the
   new directory and add the files in it with the add file cvs command given above. Once the addition is complete, we have to do 
   cvs ci to commit all the chhanges.
   Note : If a directory contains many files, to add all the files at once do cvs add *. This adds all the files and then 
   do the cvs ci.

For more information on CVS administration, read:

 The book "Opensource Development with CVS" here: http://cvsbook.red-bean.com/
 
 and the Cederqvist manual that comes with CVS.