1 #!/bin/sh 2 3 # $NetBSD: cvs.sh.sh,v 1.2 2003/07/12 23:02:59 atatat Exp $ 4 5 # ensure that HOME is set for pserver modes 6 UID=`id -u` 7 export HOME=`awk -F: '$3=='"$UID"'{print$6}' /etc/passwd` 8 # supplement path to include ssh and cvs 9 export PATH=/usr/pkg/bin:$PATH 10 # use ssh instead of rsh for cvs connections 11 export CVS_RSH=ssh 12 13 case $1 in 14 netbsd) 15 export CVSROOT="anoncvs (at] anoncvs.netbsd.org:/cvsroot" 16 shift 17 ;; 18 freebsd) 19 export CVSROOT=":pserver:anoncvs (at] anoncvs.freebsd.org:/home/ncvs" 20 shift 21 ;; 22 openbsd) 23 export CVSROOT="anoncvs (at] anoncvs.usa.openbsd.org:/cvs" 24 shift 25 ;; 26 *) 27 echo "configuration not supported" 28 exit 0 29 esac 30 31 for file; do 32 if ( echo $file | egrep -qi '(.*),(-r)?([0-9\.]+|[-_a-z0-9]+)$' ); then 33 rev="-r`expr "$file" : '.*,\(.*\)' | sed 's/^-r//'`" 34 file="`expr "$file" : '\(.*\),.*'`" 35 else 36 rev="" 37 fi 38 cvs co -p $rev $file 39 done 40