Speedy CVS Updates

SCU (or Speedy CVS Updates) is a script I wrote to quickly synchronize a (source) tree with a CVS repository. It saves resources on your machine as well as on the CVS server. SCU uses logfiles like this generated from the mails sent when the repository is changed. (See for example the archive of NetBSD's source-changes mailing list.) By comparing the revisions of files in the local tree with those in the logfiles, the script finds out how out-of-date the tree is and then executes CVS commands to only update those files and/or directories that are behind. It's a bit more complicated than that because of deletion of files and directories, imports, and the fact that adding directories is not visible in the logs.

SCU delivers the best results for CVS branches that are infrequently updated (for example NetBSD stable branches) or for trees that are frequently updated locally. On my Cobalt RaQ 2 an update of a week old netbsd-2-0 took 45s with SCU. Updating the whole (already up-to-date) tree with CVS took 1020s, whereas a new run of SCU took only 17s. Speed gains depend of course on CPU and disk speed; my workstation at work needs only 1s (SCU) versus 507s (CVS) to determine the same source tree is up-to-date.

The latest version is 1.5. Changelog

How to use? Easy! Just change directories to the top of a checked out CVS tree and run "scu". There are a few environment variables that will affect SCU's execution. These variables can also be set in $HOME/.scu.conf or in a file of your choice if you set SCUCFG in your environment:

AUTOUPD
Auto-update. If set to "Yes", checks whether a new version of SCU is available on $DISTSITE and if so, downloads the latest version and executes it. If set to "No", SCU doesn't check for new versions. If left empty (the default) or set to something else, SCU will report whether a new version is available and if so will display a changelog since your current version.
CVSOPTS
CVS options. These will be passed to cvs for updating. Note that you shouldn't use this to set the CVS root (through "-d") as this is already set to CVSROOT from your environment if it exists or from CVS/Root. If you need to change the CVS root, just set it in $SCUCFG. Also, don't set the compression ("-z") higher than 3, unless you have the CVS server's owner's permission.
DEBUG
Debug level. The higher, the more verbose SCU will be and the more it will sleep and waste time running unnnecessary stuff to make it easy to investigate what the script is doing. Setting DEBUG to 1 or higher results in temporary files in CVS/ not being cleaned up at exit.
RBASE
Prefix of remote log directories. The default is "logs/nb-".
RSITE
Remote site where commit logs are fetched. Defaults to "http://scu.bsdusr.net".
RDIR
Remote directory of a CVS tree's commit logs. By default set to ${RSITE}/${RBASE}<rep><br>, where <rep> is the name of the repository (like "src") and <br> is the name of the branch without the "-"'s (like "netbsd3" or "pkgsrc2005Q2"). Commit logs of all active branches of NetBSD repositories (htdocs, othersrc, pkgsrc, src, and xsrc) are available on http://scu.bsdusr.net. SCU first looks for $RDIR/index and then for each file read from that index.
Dieter Roelants, 2005
Powered by NetBSD [NetBSD rules!]