26Sep/110
How to easy CVS update your SRC and Ports tree with a simple Bash script (v2)
This is an update to this post: How to easy CVS update your SRC and Ports tree with a simple Bash script
I adjusted the script to use the local csup version of the FreeBSD World system and moved the cvsup files to /etc.
First install a simple tool to get the fastest cvs server
pkg_add -r fastest_cvsup
Or from Ports (if you have the collection already):
cd /usr/ports/sysutils/fastest_cvsup/ make install clean
Setup config and binary to easy update the repository for SRC and PORTS.
mkdir /etc/cvsup cd /usr/share/examples/cvsup cp stable-supfile /etc/cvsup cp ports-supfile /etc/cvsup cp doc-supfile /etc/cvsup cd /etc/cvsup
Edit stable-supfile and change:
*default release=cvs tag=RELENG_8_2
Set this to your release version.
Edit /usr/local/sbin/runcvsup and add:
#!/bin/sh arg=$@ sType="tld,nl" # Can be: all / tld / tld,nl,de,fr,us if SERVER=`/usr/local/bin/fastest_cvsup -q -c $sType`; then echo "Using server: ${SERVER}" case "$arg" in "stable") echo "Updating: stable" /usr/bin/csup -L 2 -g -z -h ${SERVER} /etc/cvsup/stable-supfile ;; "ports") echo "Updating: ports" /usr/bin/csup -L 2 -g -z -h ${SERVER} /etc/cvsup/ports-supfile ;; "doc") echo "Updating: doc" /usr/bin/csup -L 2 -g -z -h ${SERVER} /etc/cvsup/doc-supfile ;; *) echo "Updating: all" /usr/bin/csup -L 2 -g -z -h ${SERVER} /etc/cvsup/stable-supfile /usr/bin/csup -L 2 -g -z -h ${SERVER} /etc/cvsup/ports-supfile /usr/bin/csup -L 2 -g -z -h ${SERVER} /etc/cvsup/doc-supfile ;; esac fi
Set the right permissions:
chmod 700 /usr/local/sbin/runcvsup
Update everything:
runcvsup




