Home | History | Annotate | Line # | Download | only in examples
cvs.sh.sh revision 1.3
      1 #!/bin/sh
      2 
      3 #	$NetBSD: cvs.sh.sh,v 1.3 2003/07/26 19:46:33 salo 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