Using cvs for package management
From DANSE
The manual pages for "cvs" can be found by ssh'ing to arcs.cacr.caltech.edu, then typing "man cvs".
Documentation can also be found at https://www.cvshome.org/docs/
Also see:
- Paul Kienzle's command-line CVS hints
- How to setup your own cvs repository (http://www.student.cs.uwaterloo.ca/~fh2chen/CVS_HOWTO.html).
Adding a new package
New packages can be added to the repository with cvs. There are typically two ways to do this -- either by adding to an existing directory or by creating a new directory within the cvs tree.
Adding a new directory and importing all package sources into the repository can be done in a single command. For a package named "mypackage" that is found on your computer at "~/myprogs/mypackage", import "mypackage" to cvs with:
1) cd to "mypackage" directory
cd ~/myprogs/mypackage
2) import all sources in current directory
cvs -d cvs.cacr.caltech.edu:/srv/cvs/danse import danse/foo/mypackage mypackage v1
This should create a new directory for your code at "danse/foo/mypackage". Please, notify the DANSE team if you do not recieve an email notification for your new package (email: Mike McKerns).
There should now be a new directory at the cvs branch you have indicated above, and it is accessable to other developers. You can then change to your "dv" directory, and checkout your new package from the repository:
3) cd to $DV_DIR
cd $DV_DIR
4) checkout your new package
cvs -d cvs.cacr.caltech.edu:/srv/cvs/danse checkout danse/foo/mypackage
Another method of adding a new package is to add to an existing directory. For example, we could have added "mypackage" to the "foo" directory like this:
1) cd to $DV_DIR
cd $DV_DIR
2) checkout the target parent package (if not already checked out)
cvs -d cvs.cacr.caltech.edu:/srv/cvs/danse co danse/foo
3) cd to foo directory
cd danse/foo
4) copy your package to the "foo" directory
cp ~/olddir/mypackage danse/foo
5) add your package directory to "foo"
cvs add mypackage
6) commit your changes to the repository
cvs commit
Now you can proceed to "cvs add" and "cvs commit" until you have added all subdirectories and files inside of the new package. Email notification will be automatic when adding to an existing directory.
NOTE: there is a non-spamming directory in the DANSE repository (called "sandbox") that allows you to try out using the cvs repository. This directory can be checked out with the following command.
cvs -d cvs.cacr.caltech.edu:/srv/cvs/danse co sandbox
Updating a package
Typically, notifications of updates to packages held in the cvs repository on cvs.cacr.caltech.edu will come via email. If the email notice imforms you that "arcs/packages/ins/reduction" has been updated, and you have not already checked out the package, then simply do so by:
1) cd to $DV_DIR
cd $DV_DIR
2) checkout desired package
cvs -d cvs.cacr.caltech.edu:/srv/cvs/arcs co arcs/packages
If you have previously checked out the desired package (again, let's use "arcs/packages/ins/reduction"), then you can just update your local directory with:
1) cd to $DV_DIR
cd $DV_DIR
2) cd to desired package directory
cd arcs/packages/ins/reduction
3) update your files
cvs -q update
However, when the email notification shows that a new sub-directory has been added, it is usually best to re-checkout the parent of the new sub-directory. For example, if "foo" was added to "arcs/packages/ins".
1) cd to $DV_DIR
cd $DV_DIR
2) re-checkout the parent of the desired directory
cvs -d cvs.cacr.caltech.edu:/srv/cvs/arcs co packages/ins
Further, some core package updates do not currently send email notifications -- among them config, pythia-0.8, and templates. You should synchronize your files with the repository every so often, just to keep yourself up-to-date. Explicit instructions for these three packages are included below, and are generally applicable to any anonymous access cvs repository.
1) cd to $DV_DIR
cd $DV_DIR
2) re-checkout config
cvs -d :pserver:config@cvs.cacr.caltech.edu:/config co config
3) re-checkout pythia-0.8
cvs -d :pserver:pyre@cvs.cacr.caltech.edu:/pyre co pythia-0.8
4) re-checkout templates
cvs -d :pserver:pyre@cvs.cacr.caltech.edu:/pyre co templates
Less critical updates can be done with "cvs -q update", for example to update "templates":
1) cd to $DV_DIR/templates
cd $DV_DIR/templates
2) update the package
cvs -q update
After updating a core package (config, pythia-0.8, or templates), you should usually rebuild the package. For example, to rebuild "templates":
1) cd to $DV_DIR/templates
cd $DV_DIR/templates
2) clean the installation & tidy the build directory
mm clean mm tidy
3) rebuild
mm
You can always check the update staus of a repository package through use of "diff". For example, to check the status of "pythia-0.8":
1) cd to $DV_DIR
cd $DV_DIR
2) diff your files with the repository
cvs -q diff pythia-0.8
This should tell you what kind of updating you need to perform.
