Skip to content. | Skip to navigation

Sections
Personal tools

9. CVS

9. CVS

We use cvs to maintain this documentation and other things such as the cyrus scripts.

9.1. Creating a repository on the server

Easy. Just cd to the directory that should hold the repository (typically /usr/local/cvsroot on a FreeBSD system) and do a cvs init. On my machines I've created a group cvs, which owns the repository. Access rights within the CVS are governed by the filepermissions on the repository. In this case, as root:

cd /usr/local
mkdir cvsroot
cd cvsroot
cvs -d:/usr/local/cvsroot init
chown -R cvs:cvs /usr/local/cvsroot
chmod -R 775 /usr/local/cvsroot

9.2. Create a package

This part I found confusing in the man and info pages. What I want to do is this: I've got a folder controlme (with files and subfolders) located in your home directory on the client machine A and wish to put it under version control on a host B (knox) (where I've created a repository according to the previous section).

The cvs documentation becomes easier to understand once you get their way of thinking.

You import controlme into B but you do this via executing commands from A.

Then you rename controlme and check out the version from B (which at this point, is of course identical to the original folder except for the added CVS information)

Using our example. you need to do the following (assuming that user tomster is a member of the group cvs):

cd ~/controlme # yes, you need to go *into* the folder!
cvs -d:ext:tomster@knox:/usr/local/cvsroot import -m "init" controlme 'tomster' 'start'
cd ..
mv controlme controlme-nocvs
cvs -d:ext:tomster@knox:/usr/local/cvsroot co controlme 

So, what did we do? The first cvs command imports everything inside the current directory into the given repository. It logs the message 'init', gives the package the name 'controlme' (which needn't be identical to the folder, but that's the way I do it). It then adds a (mandatory) 'vendortag' which I always set to my username. The last tag is the release tag, which I always set to 'start', since I haven't yet dabbled with the darker alchemy of tagging in CVS ;-)

Note

Once you're inside your controlled directory you won't need to add the -d parameter any longer: cvs is smart enough to look into the information in the CVS directories, where - among other things - the repository is stored, too.

Outdated Information
Please note that most of the information contained in this section is several years old and while most of it is still useful, hardly none of it applies directly to current versions of the software discussed. Proceed with caution, your mileage may vary etc. pp. ;-)