CVSandCGIProduction setup

From Odwiki

Jump to: navigation, search

Back to the CVS and CGI Production

Depending on your particular sites use of CVS, there will likely be a need to modify some of the files found in the $CVSROOT/CVSROOT directory. Some of these modifications will help coordinate activities amongst users, some may help to deal with application specific files such as Houdini .hip files and some help you extend the administrative capabilities such as extended logging or notification of repository changes.


Note: When editing the CVS administrative files, always cd to some temp directory, such as /tmp and checkout the CVSROOT, edit the files then check them back in. This will rebuild the administrative database correctly, i.e. update RCS files for the CVSROOT.

Here's an example of editing the CVSROOT

Important administrative files (found in $CVSROOT/CVSROOT):

The modules file is used to create shortcuts to repositories:

venus 130# cat modules
select_tut      projects/select_tutorials
top -d top_tut  projects/Top_Tutorial
setsudo         dev/setsudo
mstory_shaders  shaders/mstory_shader_lib
mstory_houdini  -d houdini user_config/mstory/houdini
shaders         NAZMA_shaders
midi            MIDI_Lib
dumpMIDI        dev/dumpMIDI

The loginfo file is used to inform users of commits to the repository:

venus 132# cat loginfo
#
# This loginfo file will call the script cvs-log and append all log message to the log file
# $CVSROOT/CVSROOT/commitlog, and any commits to the administrative files to the log file
# /var/adm/cvsroot-log.txt
# There are also entries to mail a list of users for changes to repositories they 
# are working on.
#
DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog
ALL             /usr/local/bin/cvs-log $CVSROOT/CVSROOT/commitlog $USER
^CVSROOT        /usr/local/bin/cvs-log /var/adm/cvsroot-log.txt
^projects/NAZMA_TV_Ad   Mail -s %s mstory
^CCB   Mail -s %s mstory,bmace
^MIDI_Lib   Mail -s %s mstory,caker,weyer

This is the cvs-log script:

venus 136# cat /usr/local/bin/cvs-log 
#!/bin/sh
(echo "----------------------------------------------------";
echo -n $2"  ";
date;
echo;
cat) >> $1


The notify file is used to inform users of changes:

venus mstory-68% cat notify
# The "notify" file controls where notifications from watches set by
# "cvs watch add" or "cvs edit" are sent.  The first entry on a line is
# a regular expression which is tested against the directory that the
# change is being made to, relative to the $CVSROOT.  If it matches,
# then the remainder of the line is a filter program that should contain
# one occurrence of %s for the user to notify, and information on its
# standard input.
#
# "ALL" or "DEFAULT" can be used in place of the regular expression.
#
# For example:
ALL Mail -s "CVS notification" %s


the readers and writers files are used to restrict repository changes (add readers and writers files to set permissions for read-only access to the repository and those users who can write to the repository). Contents of these files can be integrated into user management procedures to automate control over the repository:

venus 131# cat readers
mstory
caker
weyer
bmace
sprocket
kem

venus 132# cat writers
mstory
caker
weyer


The cvswrappers file allows you to set hooks which transforms files on their way in and out of CVS:

venus 122# cat cvswrappers
# This file affects handling of files based on their names.
#
# The -t/-f options allow one to treat directories of files
# as a single file, or to transform a file in other ways on
# its way in and out of CVS.
#
# The -m option specifies whether CVS attempts to merge files.
#
# The -k option specifies keyword expansion (e.g. -kb for binary).
#
# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers)
#
#  wildcard     [option value][option value]...
#
#  where option is one of
#  -f           from cvs filter         value: path to filter
#  -t           to cvs filter           value: path to filter
#  -m           update methodology      value: MERGE or COPY
#  -k           expansion mode          value: b, o, kkv, &c
#
#  and value is a single-quote delimited value.
# All of these files types will be checked into the repository as binary files 
# (no linefeed conversion and no keyword expansion).
#
# Image files
*.gif -k 'b'
*.jpg -k 'b'
*.jpeg -k 'b'
*.rgb -k 'b'
*.tif -k 'b'
*.tiff -k 'b'
*.pic -k 'b'
#
# Houdini binary files
*.hip -k 'b'
*.bgeo -k 'b'
*.bclip -k 'b'
#
# Maya binary scene files
*.mb -k 'b'
#
# Shader "binary" files
*.slc -k 'b'
*.slo -k 'b'
# Misc. files
*.gz -k 'b'


The cvsignore file to list files which will be ignored by CVS:

venus 108# cat cvsignore 
foo
*.tmp
*.so


The config file to set misc. settings in CVS

venus mstory-73% cat config
# Set this to "no" if pserver shouldn't check system users/passwords
SystemAuth=yes
# Set `PreservePermissions' to `yes' to save file status information
# in the repository.
PreservePermissions=no
# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top
# level of the new working directory when using the `cvs checkout'
# command.
#TopLevelAdmin=no


Notes: Permissions in the repository, users/groups, and NFS/NIS considerations

Suggested additions to the /etc/group file (add to NIS group map if running yp)

user::20:
cvs::200:mstory,bmace,caker,kem,weyer,sprocket
cvsadm::201:mstory,caker,weyer


Make the appropriate permissions changes in the repository to allow users to modify repository contents and certain administrative files. If running NIS ... propogate maps, read/write perms.

TODO: need examples

© 2009 od[force].net | advertise