next up previous contents
Next: Automatic Email Notification of Up: CVS Administration Notes Previous: CVS Server Setup   Contents


Handling Binary Files

CVS regards the files you put into it as plain-text source code. That works well for .html files, but causes more than a little trouble when you're trying to import and manage files that must be maintained in a binary format, such as the .gif and .jpg image files commonly found in web sites. You can configure the CVS server to recognize certain file extensions as binary and check them in to and out of the repository with extra care. Here's how we set up ours:

  1. Make yourself a working copy of the CVSROOT configuration files. Change into a working directory and issue the command:
        $ cvs co CVSROOT
        
  2. Edit the file CVSROOT/cvswrappers to tell CVS how to handle each file extension. Here's the cvswrappers file we use:
    *.GIF   -k 'b' -m 'COPY'
    *.JPG   -k 'b' -m 'COPY'
    *.avi   -k 'b' -m 'COPY'
    *.bin   -k 'b' -m 'COPY'
    *.bz    -k 'b' -m 'COPY'
    *.bz2   -k 'b' -m 'COPY'
    *.doc   -k 'b' -m 'COPY'
    *.exe   -k 'b' -m 'COPY'
    *.gif   -k 'b' -m 'COPY'
    *.gz    -k 'b' -m 'COPY'
    *.hqx   -k 'b' -m 'COPY'
    *.jar   -k 'b' -m 'COPY'
    *.jpeg  -k 'b' -m 'COPY'
    *.jpg   -k 'b' -m 'COPY'
    *.mov   -k 'b' -m 'COPY'
    *.mp3   -k 'b' -m 'COPY'
    *.mpg   -k 'b' -m 'COPY'
    *.pdf   -k 'b' -m 'COPY'
    *.png   -k 'b' -m 'COPY'
    *.ppt   -k 'b' -m 'COPY'
    *.rpm   -k 'b' -m 'COPY'
    *.sit   -k 'b' -m 'COPY'
    *.srpm  -k 'b' -m 'COPY'
    *.swf   -k 'b' -m 'COPY'
    *.tar   -k 'b' -m 'COPY'
    *.tbz   -k 'b' -m 'COPY'
    *.tgz   -k 'b' -m 'COPY'
    *.tif   -k 'b' -m 'COPY'
    *.tiff  -k 'b' -m 'COPY'
    *.xbm   -k 'b' -m 'COPY'
    *.xls   -k 'b' -m 'COPY'
    *.zip   -k 'b' -m 'COPY'
    
  3. Commit your changes to the CVS repository:
    $ cvs commit -m"added common binary files"
    cvs commit: Examining .
    Checking in cvswrappers;
    /usr/local/cvs-repository/CVSROOT/cvswrappers,v  <--  cvswrappers
    new revision: 1.4; previous revision: 1.3
    done
    cvs server: Rebuilding administrative file database
        


next up previous contents
Next: Automatic Email Notification of Up: CVS Administration Notes Previous: CVS Server Setup   Contents

copyright © 1997-1999 sean dreilinger.