3 # these are helper functions for doing localized revision control.
4 # this script should be sourced into other scripts that use it.
7 # gets the machine's hostname and stores it in the variable "this_host".
8 function get_our_hostname()
10 if [ "$OS" == "Windows_NT" ]; then
12 elif [ ! -z "$(echo $MACHTYPE | grep apple)" ]; then
14 elif [ ! -z "$(echo $MACHTYPE | grep suse)" ]; then
15 this_host=$(hostname --long)
19 #echo "hostname is $this_host"
22 # this function sets a variable called "home_system" to "true" if the
23 # machine is considered one of fred's home machines. if you are not
24 # fred, you may want to change the machine choices.
26 function is_home_system()
28 # load up the name of the host.
30 # reset the variable that we'll be setting.
32 if [[ $this_host == *.gruntose.blurgh ]]; then
35 elif [[ $this_host == buildy ]]; then
37 elif [[ $this_host == simmy ]]; then
43 # we only want to totally personalize this script if the user is right.
46 if [ "$USER" == "fred" ]; then
47 export SVNUSER=fred_t_hamster@
48 export EXTRA_PROTOCOL=+ssh
51 export EXTRA_PROTOCOL=
55 # calculates the right modifier for hostnames / repositories.
57 function compute_modifier()
63 # some project specific overrides.
64 if [[ "$directory" == hoople* ]]; then
65 modifier="svn${EXTRA_PROTOCOL}://${SVNUSER}svn.code.sf.net/p/hoople2/svn/"
67 if [[ "$directory" == yeti* ]]; then
68 modifier="svn${EXTRA_PROTOCOL}://${SVNUSER}svn.code.sf.net/p/yeti/svn/"
70 # see if we're on one of fred's home machines.
72 # special override to pick local servers when at home.
73 if [ "$home_system" == "true" ]; then
74 if [ "$in_or_out" == "out" ]; then
75 # need the right home machine for modifier when checking out.
76 modifier="svn://shaggy/"
78 # no modifier for checkin.