Difference between revisions of "Concurrent Versions System"

From ArchWiki
Jump to: navigation, search
m
Line 72: Line 72:
 
   /home/cvsroot/CVSROOT/passwd  # user and passwd, refer to the following
 
   /home/cvsroot/CVSROOT/passwd  # user and passwd, refer to the following
 
    
 
    
   anonymous::cvsroot
+
   anonymous::
   lnzju:YKy0EJBP5vDpY:cvsroot
+
   lnzju:YKy0EJBP5vDpY:cvs
  
  

Revision as of 13:40, 27 July 2007


01) Open up a shell


02) su to root


03) Make sure you have the latest version of CVS

pacman -Sy cvs


04) Make sure you have the latest version of xinetd

pacman -S xinetd


05) Now create the directory that will become your CVS repository.

mkdir /home/cvsroot


06) Initialize your CVS repository

cvs init -d /home/cvsroot


07) Create a group called cvs - members of this group will have write access to the repository

groupadd cvs


08) Create a user named cvs

useradd -d /home -g cvs -p password cvs


09) Set the owner and group of the repository

chown -R cvs:cvs /home/cvsroot


10) Set the proper permissions for the repository(set group ID, owner: read write execute, group: read write execute, others: read execute)

chmod 2775 /home/cvsroot


Add any users that you want to have local access to the repository to the group cvs by using the following two steps.


11) Get a list of the groups for a user.

groups someuser


12) Set the groups for the user. The group1 group2 etc. are the groups you got from the previous step. NOTE: make sure not to use spaces when listing the additional groups

usermod -g users -G group1,group2,group3,cvs someuser


13) Make a file in /etc/xinetd.d/ called cvspserver with these contents:

service cvspserver
{
        port            = 2401
        socket_type     = stream
        protocol        = tcp
        wait            = no
        user            = root
        passenv         = /home/cvsroot
        server          = /usr/bin/cvs
        server_args     = -f --allow-root=/home/cvsroot pserver
}

14) Edit /etc/services and add cvspserver service if does not exist:

cvspserver 2401/tcp #CVS PServer


15) Create some files in CVSROOT

 /home/cvsroot/CVSROOT/passwd  # user and passwd, refer to the following
 
 anonymous::
 lnzju:YKy0EJBP5vDpY:cvs


 /home/cvsroot/CVSROOT/writers  #  users that have write permission of the repository,every user take a newline
 /home/cvsroot/CVSROOT/readers  #  users that have read permission of the repository,every user take a newline

16)Allow clients to connect to the Server

edit /etc/hosts.allow ,add a newline ,as the following

 cvs:ALL


17) You must unset the variable HOME before you restart xinetd

unset HOME


18) Restart the xinetd server

/etc/rc.d/xinetd restart


You can test out the server using the following commands:

export CVSROOT=:pserver:my_user_name@127.0.0.1:/home/cvsroot
cvs login
mkdir ~/sandbox
mkdir ~/sandbox/myproject
cd ~/sandbox/myproject
echo "this is a sample file" > myfile
cvs import -m "description of myproject" myproject v1 r1
cd ..
rm -R myproject
cvs checkout myproject
cd myproject
echo "some changes to the file" >> myfile
cvs commit -m "Explain changes here" myfile