-this_host=
-# gets the machine's hostname and stores it in the variable "this_host".
-function get_our_hostname()
-{
- if [ "$OS" == "Windows_NT" ]; then
- this_host=$(hostname)
- elif [ ! -z "$(echo $MACHTYPE | grep apple)" ]; then
- this_host=$(hostname)
- elif [ ! -z "$(echo $MACHTYPE | grep suse)" ]; then
- this_host=$(hostname --long)
- else
- this_host=$(hostname)
- fi
- #echo "hostname is $this_host"
-}
-
-# this function sets a variable called "home_system" to "true" if the
-# machine is considered one of fred's home machines. if you are not
-# fred, you may want to change the machine choices.
-export home_system=
-function is_home_system()
-{
- # load up the name of the host.
- get_our_hostname
- # reset the variable that we'll be setting.
- home_system=
- if [[ $this_host == *.gruntose.blurgh ]]; then
- home_system=true
-#temp code
-elif [[ $this_host == buildy ]]; then
-home_system=true
-elif [[ $this_host == simmy ]]; then
-home_system=true
-#temp code
- fi
-}
-
-#hmmm: move to core.
-# makes sure that the "folder" is a directory and is writable.
-# remember that bash successful returns are zeroes...
-function test_writeable()
-{
- local folder="$1"; shift
- if [ ! -d "$folder" -o ! -w "$folder" ]; then return 1; fi
- return 0
-}
-
-# we only want to totally personalize this script if the user is right.
-function check_user()
-{
- if [ "$USER" == "fred" ]; then
- export SVNUSER=fred_t_hamster@
- export EXTRA_PROTOCOL=+ssh
- else
- export SVNUSER=
- export EXTRA_PROTOCOL=
- fi
-}
-
-# calculates the right modifier for hostnames / repositories.
-modifier=
-function compute_modifier()
-{
- modifier=
- directory="$1"; shift
- in_or_out="$1"; shift
- check_user
- # some project specific overrides.
- if [[ "$directory" == hoople* ]]; then
- modifier="svn${EXTRA_PROTOCOL}://${SVNUSER}svn.code.sf.net/p/hoople2/svn/"
- fi
- if [[ "$directory" == yeti* ]]; then
- modifier="svn${EXTRA_PROTOCOL}://${SVNUSER}svn.code.sf.net/p/yeti/svn/"
- fi
- # see if we're on one of fred's home machines.
- is_home_system
- # special override to pick local servers when at home.
- if [ "$home_system" == "true" ]; then
- if [ "$in_or_out" == "out" ]; then
- # need the right home machine for modifier when checking out.
-#huhhh? modifier="svn://shaggy/"
- modifier=
- else
- # no modifier for checkin.
- modifier=
- fi
- fi
-}