Updating Sources with CVSup

Updating Sources with CVSup

Applicable to: FreeBSD 5.x
Updated: September 22nd, 2007

This Sheet describes the procedure used to keep the FreeBSD source code and the ports collection up to date. Before performing this procedure, you should review the FreeBSD Handbook articles Staying Stable with FreeBSD and Using CVSup.

  1. If sources are not yet installed in /usr/src, use Sysinstall to install them:

    # sysinstall

    Choose Configure|Distributions|Source.

    While CVSup will install the sources if they are not present, your CVSup run will go much faster (especially if you have a slow Internet connection) if you first install the sources from the CD, so that CVSup only has to make differential changes.

  2. If not already done, install the CVSup port:

    # cd /usr/ports/net/cvsup-without-gui && make && make install && make clean

  3. Create the /usr/local/etc/cvsup/sup directory tree:

    # mkdir -p /usr/local/etc/cvsup/sup

  4. Create /usr/local/etc/cvsup/sup/supfile: *default host=cvsup8.FreeBSD.org (Pick a mirror near you, see below)
    *default base=/usr/local/etc/cvsup
    *default prefix=/usr
    *default release=cvs tag=RELENG_5
    *default delete use-rel-suffix
    *default compress
    src-all
    ports-all tag=.

    Mirror sites are listed here.

  5. Create the refuse file /usr/local/etc/cvsup/sup/refuse
    If you don’t have a lot of disk space to spend on language-specific collections, create a refuse file with these entries (omit languages from this list that you actually want): doc/bn_*
    doc/da_*
    doc/de_*
    doc/el_*
    doc/es_*
    doc/fr_*
    doc/it_*
    doc/ja_*
    doc/nl_*
    doc/no_*
    doc/pl_*
    doc/pt_*
    doc/ru_*
    doc/sr_*
    doc/tr_*
    doc/zh_*
    ports/arabic
    ports/chinese
    ports/french
    ports/german
    ports/hebrew
    ports/hungarian
    ports/japanese
    ports/korean
    ports/polish
    ports/portuguese
    ports/russian
    ports/ukrainian
    ports/vietnamese
  6. Create /usr/local/bin/cvsrun:

     

    #!/bin/sh

    echo Subject: `hostname` weekly cvsup run output

    /usr/local/bin/cvsup -g -L 2 /usr/local/etc/cvsup/sup/supfile

    Make the scripts executable by root only:

    # chown root:wheel /usr/local/bin/cvsrun

    # chmod u+x /usr/local/bin/cvsrun

  7. Edit /etc/crontab to run CVSup every Friday night:

    # Run cvsup every Friday night at 10:00 pm.

    0 22 * * 5 root /usr/local/bin/cvsrun | sendmail root

  8. Run cvsup to update the sources:

    # /usr/local/bin/cvsrun

Leave a Reply

Your email address will not be published. Required fields are marked *