PostgreSQL 8.2.10 Documentation
Prev | Fast Backward | Appendix F. The CVS Repository | Fast Forward | Next

# F.3. Getting The Source Via CVSup

An alternative to using anonymous CVS for retrieving the PostgreSQL source tree is CVSup. CVSup was developed by John Polstra (`<jdp@polstra.com>`) to distribute CVS repositories and other file trees for the FreeBSD project.

A major advantage to using CVSup is that it can reliably replicate the entire CVS repository on your local system, allowing fast local access to `cvs` operations such as `log` and `diff`. Other advantages include fast synchronization to the PostgreSQL server due to an efficient streaming transfer protocol which only sends the changes since the last update.

## F.3.1. Preparing A CVSup Client System

Two directory areas are required for CVSup to do its job: a local CVS repository (or simply a directory area if you are fetching a snapshot rather than a repository; see below) and a local CVSup bookkeeping area. These can coexist in the same directory tree.

Decide where you want to keep your local copy of the CVS repository. On one of our systems we recently set up a repository in `/home/cvs/`, but had formerly kept it under a PostgreSQL development tree in `/opt/postgres/cvs/`. If you intend to keep your repository in `/home/cvs/`, then put

    setenv CVSROOT /home/cvs

in your `.cshrc` file, or a similar line in your `.bashrc` or `.profile` file, depending on your shell.

The cvs repository area must be initialized. Once `CVSROOT` is set, then this can be done with a single command:

    cvs init

after which you should see at least a directory named `CVSROOT` when listing the `CVSROOT` directory:

    $ ls $CVSROOT
    CVSROOT/

## F.3.2. Running a CVSup Client

Verify that cvsup is in your path; on most systems you can do this by typing

    which cvsup

Then, simply run cvsup using:

    cvsup -L 2 postgres.cvsup

where `-L 2` enables some status messages so you can monitor the progress of the update, and `postgres.cvsup` is the path and name you have given to your CVSup configuration file.

Here is a CVSup configuration file modified for a specific installation, and which maintains a full local CVS repository:

    # This file represents the standard CVSup distribution file
    # for the PostgreSQL ORDBMS project
    # Modified by lockhart@fourpalms.org 1997-08-28
    # - Point to my local snapshot source tree
    # - Pull the full CVS repository, not just the latest snapshot
    #
    # Defaults that apply to all the collections
    *default host=cvsup.postgresql.org
    *default compress
    *default release=cvs
    *default delete use-rel-suffix
    # enable the following line to get the latest snapshot
    #*default tag=.
    # enable the following line to get whatever was specified above or by default
    # at the date specified below
    #*default date=97.08.29.00.00.00

    # base directory where CVSup will store its 'bookmarks' file(s)
    # will create subdirectory sup/
    #*default base=/opt/postgres # /usr/local/pgsql
    *default base=/home/cvs

    # prefix directory where CVSup will store the actual distribution(s)
    *default prefix=/home/cvs

    # complete distribution, including all below
    pgsql

    # individual distributions vs 'the whole thing'
    # pgsql-doc
    # pgsql-perl5
    # pgsql-src

If you specify `repository` instead of `pgsql` in the above setup, you will get a complete copy of the entire repository at cvsup.postgresql.org, including its `CVSROOT` directory. If you do that, you will probably want to exclude those files in that directory that you want to modify locally, using a refuse file. For example, for the above setup you might put this in `/home/cvs/sup/repository/refuse`:

    CVSROOT/config*
    CVSROOT/commitinfo*
    CVSROOT/loginfo*

See the CVSup manual pages for how to use refuse files.

The following is a suggested CVSup configuration file from the PostgreSQL ftp site which will fetch the current snapshot only:

    # This file represents the standard CVSup distribution file
    # for the PostgreSQL ORDBMS project
    #
    # Defaults that apply to all the collections
    *default host=cvsup.postgresql.org
    *default compress
    *default release=cvs
    *default delete use-rel-suffix
    *default tag=.

    # base directory where CVSup will store its 'bookmarks' file(s)
    *default base=/usr/local/pgsql

    # prefix directory where CVSup will store the actual distribution(s)
    *default prefix=/usr/local/pgsql

    # complete distribution, including all below
    pgsql

    # individual distributions vs 'the whole thing'
    # pgsql-doc
    # pgsql-perl5
    # pgsql-src

Prev | Home | Next
CVS Tree Organization | Up | Documentation