0

[FreeBSD]Updating Sources with CVSup

If the sources are not installed in /usr/src use sysinstall to install it :
# /usr/sbin/sysinstall

edit /etc/make.conf and add
WITHOUT_X11=yes

Install the CVSup port
# cd /usr/ports/net/cvsup-without-gui
# make && make install && make clean

Create the work directory /usr/local/etc/cvsup/sup
# mkdir -p /usr/local/etc/cvsup/sup

Create the file /usr/local/etc/cvsup/sup/supfile

*default host=cvsup4.FreeBSD.org
*default base=/usr/local/etc/cvsup
*default prefix=/usr
*default release=cvs tag=RELENG_6
*default delete use-rel-suffix
*default compress
src-all
ports-all tag=.

Install the portupgrade utility to make managing ports easier
# cd /usr/ports/sysutils/portupgrade
# make && make install && make clean

Create /usr/local/bin/cvsrun to automate CVSup
#! /bin/sh
# cvsrun - Weekly CVSup Run

echo "Subject: `hostname` weekly cvsup run"
/usr/local/bin/cvsup -g -L 2 /usr/local/etc/cvsup/sup/supfile
echo ""
if [ $# -eq 1 ] ; then
if [ $1 = "-i" ] ; then
/usr/local/sbin/portsdb -Uu 2>&1
echo
fi
fi
echo ""
echo "cvsrun done."

Make the script executable by root only
# chmod 0700 /usr/local/bin/cvsrun

Create /usr/local/bin/portreport to create a mailable port version report
#! /bin/sh
#
# portreport - Port Version Report

echo Subject: `hostname` port version report
echo Content-type: text/html
echo
echo
echo ""
portversion -v
echo
echo End of Report.
echo ""

Again make the script executable by root only
# chmod 0700 /usr/local/bin/portreport

Edit /etc/crontab to run CVSup weekly
#run cvsup every Friday
0 22 * * 5 root /usr/local/bin/cvsrun -i | sendmail root; /usr/local/bin/portreport | sendmail root

If you are planning to run CVSup manually then run
# /usr/local/bin/cvsrun -i

jlim0930

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.