setcvs() {
    export done="no"
    if  [ "$1" = "unset" ]  
    # we want to clear all of the variables
	then
	echo -n "Clearing cvs related variables:  "
	export CVSROOT=""
	export CVS_RSH=""
	export done="yes"
	echo "done"
    fi
    if ( pwd | grep projects/reporting &gt; /dev/null &amp;&amp; \ 
       [ "$done" != "yes" ] )
    # if we're in the reporting area, and we're not already done   
	then 
	echo -n "Setting up cvs for reporting project:  "
	export CVSROOT="issdata:/usr/local/cvs/"
	export CVS_RSH="ssh"
	export done="yes"
	echo "done"
    fi
    if ( pwd | grep projects/nightly  &gt; /dev/null &amp;&amp; \ 
       [ "$done" != "yes" ] )
    # if we're in the nightly area, and we're not already done
	then
	echo -n "Setting up cvs for nightly project:  "
	export CVSROOT="/home/cvs/"
	export done="yes"
	echo "done"
    fi
    if  [ "$1" = "update" ]
    # we want to update the current tree from the cvs server after
    # setting up the right variables 
	then       
	    if [ -z "$CVSROOT" ]
	    # if there is a zero length $CVSROOT (it has already been
	    # cleared or was never set) throw an error and do nothing 
      		then
		echo "no cvs variables set ... check your cwd and try again"
	    elif [ -n "$CVSROOT" ]
	    # if there is a $CVSROOT try and do the update
		then
		echo "updating local tree"
		cvs -q update
		echo "done"
	    fi
    fi
}
