Skip to content.

UPR HPCf

Sections
Personal tools
You are here: Home » Members » humberto's Home » Test ZWiki » AddCVSProject
Views

AddCVSProject

last edited 6 years ago by cheo

QUICK AND DIRTY (BUT NOT SHORT) GUIDE TO ADDING A CVS PROJECT CALLED VOODOO

Server-side setup (Done as root in the cvs server)

  • Create a directory for your project under the CVS repository (which I'll refer to as CVSROOT, in our current setup is /usr/local/cvsroot). In this case, my project dir will be CVSROOT/voodoo. Leave for now root as the owner and group of this directory. It should be writable by user and group, and everybody should have read access to it.
    - Create a system user/group for your new project (I'll call them voodoo so I'll remember which user/group goes with which project). Make sure it doesn't have a login shell (use /bin/false) and that it's not in /etc/shadow (I don't remember the reason for the latter, but that's what we have right now and it works... most surely it's just that I forgot to put it there :-). Also make its $HOME be CVSROOT/voodoo. CVS will run under this user when somebody from this project logs in. Word of advise: Don't use adduser/useradd/linuxconf/anything-that-makes-creating-a-user-a-snap. Be a man and edit /etc/passwd and /etc/group by hand!!! :^) No really, because this is not a your normal-everyday-new-user, if you use one of those programs you'll most surely end up editing the files anyway!!
    - Add your new user to the list of user's that belong to the cvs anonymous group. In our case, this group is called cvs, so just edit /etc/group and add voodoo after the last colon on cvs' line.
    - Go back to your project's directory, and change its owner:group to the user you just created (voodoo:voodoo).
    - Edit CVSROOT/modules so CVS will know about your project (the docs recommend that you check out the file, edit it and check it in). The file is well documented. In our case, you just need to add a line:
    voodoo voodoo
    - Edit CVSROOT/passwd to tell CVS the users that'll be working on your new project. The docs recommended that you edit it directly instead of checking it out. The main advantage of using this file is that you'll be able to have many programmers working on a single project without having to create a system account for each programmer. In fewer words it maps many real-world programmer-names to a single cvs-project-username. Its format is:
    cvs-user:cvs-password:system-user
    cvs-user and cvs-password are the user/password your programmers will use to log into the cvs server. In our case, let's say programmers dida and dido will be working on our project voodoo. Then each one will have an entry in CVSROOT/passwd that looks like:
    dida:< dida's password >:voodoo
    dido:< dido's password >:voodoo
    The passwords are encrypted using the standard crypt() function, so you can copy/paste it from /etc/passwd. Keep in mind that this password is passed in the clear over the network when you log in, so don't use a mission-critical password!!
    - Edit CVSROOT/writers and add your programmers (dida and dido) to the list (you can just edit it instead of checking it out).
    - I can't remember if this is necessary, but just to play it safe: Go to the locks directory (check CVSROOT/config for the line LockDir? and go to that dir, in our case /var/lock/cvs) and create a new directory voodoo. Make sure it's owned by voodoo, has group cvs (or your anonymous user group), it's setgid, and both owner and group have write access to it (drwxrwsr-x).

Voila! You're finished with the server. All that's left is import your files and start cvs'ing!!!

Client side setup (Here I become dida's alter-ego in a remote machine)

  • Go to dida's project directory, let's say:
    /home/dida/really-cool-projects-to-take-over-the-world/voodoo
    Make sure all the files in here are the one's that are supposed to be part of your distribution. Make sure there are no binaries, object files, tmp files, vi's .swp files (close all your vi sessions), emacs' backup files, and so on. If you're using autoconf-automake-and-friends, I recommend you do:
    $ make dist
    $ cd ..
    $ tar zxvf voodoo/voodoo-1.0.0.tar.gz (this is the file created by make dist)
    $ cd voodoo-1.0.0
    And do your initial commit from this directory. If you want to include binaries in your distribution be sure to read the section Binary Files in info cvs. Then log into the server:
    $ export CVSROOT=:pserver:dida@worldview.hpcf.upr.edu:/usr/local/cvsroot
    $ cvs login
    And now import your sources
    $ cvs import -m "Initial Comment" voodoo HPCf start
    From the cvs docs: HPCf is a "vendor tag" and start a "release tag". They may fill no purpose in this context, but since CVS requires them they must be present.
    To verify that all is good and well, do:
    $ cd ..
    $ mv voodoo voodoo.old
    $ cvs checkout voodoo
    $ diff -r voodoo voodoo.old
    < No output means everything's fine. >
    $ rm -r voodoo.old
    From the cvs docs: Erasing the original sources is a good idea, to make sure that you do not accidentally edit them in voodoo.old, bypassing CVS. Of course, it would be wise to make sure that you have a backup of the sources before you remove them.
    So, there you have it, you're now ready to keep on hacking but now with cvs' help.

Basic CVS Use

A normal cvs session:
- Login to the cvs server: cvs login
- Checkout a copy of voodoo: cvs checkout/co voodoo
- Hack away all day, add new features, hunt down bugs, break voodoo and make it work again (repeat as needed)
- Commit your copy of voodoo: cvs commit/ci (make sure that at least it compiles)
All CVS commands require you to tell them the location of your project, and it can really be a pain to be typing it all the time. Fortunately, you can tell them the location using the CVSROOT env variable. So, before starting your CVS session, make sure you set CVSROOT. A good idea is to do this in your .bashrc or whatever the name of your shell's startup script is. For voodoo and dida's case this would be something like:
$ export CVSROOT=:pserver:dida@worldview.hpcf.upr.edu:/usr/local/cvsroot

I recommend you go and read info cvs (do info info if you don't know how to use the info system). There's too many things about CVS and it'd be impossible for me to explain them all. Useful sections (if you're in a hurry) are:
- Overview -> A Sample Session
- Starting a new project
- Adding and removing

CVS client GUI
To simplify your cvs sessions
tkcvs can be found at http://www.twobarleycorns.net/tkcvs.html

Ok, that's it. Happy CVS'ing!

-- Main.RicardoBaratto? - 20 Aug 2001
Tkcvs.Jose R. Ortiz - 1 Aug 2003
 

Powered by Plone

This site conforms to the following standards: