CVS Sources

Rather than working with a source tarball, it is possible to use upstream's CVS server directly. This can be useful when there is a need to test unreleased snapshots on a regular basis.

Disadvantages of CVS Sources

Note that CVS ebuilds should not generally be added to the tree for the following reasons:

It is safer to make a snapshot instead. For example, vim snapshots are made using:

$ cvs -z3 -d :pserver:anonymous@cvs.sourceforge.net:/cvsroot/vim export -r HEAD vim

Disadvantages of CVS Live Sources

CVS ebuilds which work against CVS HEAD rather than a specific date or revision are even worse candidates for tree inclusion:

Using CVS Sources

To use a CVS source, cvs.eclass must be inherited, and then a number of variables must be set. The following variables are often useful:

Variable Purpose Example
ECVS_SERVER Server and path "cvs.sourceforge.net:/cvsroot/vim"
ECVS_MODULE Module "vim"
ECVS_BRANCH Branch "HEAD"
ECVS_AUTH Auth method "ext"
ECVS_USER Username "anoncvs"
ECVS_PASS Password ""
ECVS_TOP_DIR Unpack location "${DISTDIR}/cvs-src/${ECVS_MODULE}"

See the eclass itself for the full range of options. To perform the actual checkout, use the cvs_src_unpack function.

Here's a simple example, based upon the CVS options in vim.eclass:

inherit cvs

SRC_URI=""

src_unpack() {
    ECVS_SERVER="cvs.sourceforge.net:/cvsroot/vim"
    ECVS_USER="anonymous"
    ECVS_PASS=""
    ECVS_AUTH="pserver"
    if [[ $(get_major_version ) -ge 7 ]] ; then
        ECVS_MODULE="vim7"
    else
        ECVS_MODULE="vim"
    fi
    ECVS_TOP_DIR="${DISTDIR}/cvs-src/${ECVS_MODULE}"
    cvs_src_unpack
}

Here's another approach, based upon the emacs-cvs ebuild, which relies upon the default src_unpack provided in the eclass; this approach is simpler but less flexible:

inherit cvs

ECVS_AUTH="ext"
CVS_RSH="ssh"
ECVS_SERVER="savannah.gnu.org:/cvsroot/emacs"
ECVS_MODULE="emacs"
ECVS_BRANCH="emacs-unicode-2"
ECVS_USER="anoncvs"
ECVS_PASS=""
ECVS_CVS_OPTIONS="-dP"

# ...and so on. No src_unpack() is specified.