3 # these are helper functions for doing localized revision control.
4 # this script should be sourced into other scripts that use it.
6 # one unpleasantry to take care of first; cygwin barfs aggressively if the TMP directory
7 # is a DOS path, but we need it to be a DOS path for our XSEDE testing, so that blows.
8 # to get past this, TMP gets changed below to a hopefully generic and safe place.
10 if [[ "$TMP" =~ .:.* ]]; then
11 echo making weirdo temporary directory for DOS path.
12 export TMP=/tmp/rev_control_$USER
14 if [ ! -d "$TMP" ]; then
17 if [ ! -d "$TMP" ]; then
18 echo "Could not create the temporary directory TMP in: $TMP"
19 echo "This script will not work properly without an existing TMP directory."
23 # gets the machine's hostname and stores it in the variable "this_host".
24 function get_our_hostname()
26 if [ "$OS" == "Windows_NT" ]; then
28 elif [ ! -z "$(echo $MACHTYPE | grep apple)" ]; then
30 elif [ ! -z "$(echo $MACHTYPE | grep suse)" ]; then
31 this_host=$(hostname --long)
35 #echo "hostname is $this_host"
38 # this function sets a variable called "home_system" to "true" if the
39 # machine is considered one of fred's home machines. if you are not
40 # fred, you may want to change the machine choices.
42 function is_home_system()
44 # load up the name of the host.
46 # reset the variable that we'll be setting.
48 if [[ $this_host == *.gruntose.blurgh ]]; then
51 elif [[ $this_host == buildy ]]; then
53 elif [[ $this_host == simmy ]]; then
59 # we only want to totally personalize this script if the user is right.
62 if [ "$USER" == "fred" ]; then
63 export SVNUSER=fred_t_hamster@
64 export EXTRA_PROTOCOL=+ssh
67 export EXTRA_PROTOCOL=
71 # calculates the right modifier for hostnames / repositories.
73 function compute_modifier()
79 # some project specific overrides.
80 if [[ "$directory" == hoople* ]]; then
81 modifier="svn${EXTRA_PROTOCOL}://${SVNUSER}svn.code.sf.net/p/hoople2/svn/"
83 if [[ "$directory" == yeti* ]]; then
84 modifier="svn${EXTRA_PROTOCOL}://${SVNUSER}svn.code.sf.net/p/yeti/svn/"
86 # see if we're on one of fred's home machines.
88 # special override to pick local servers when at home.
89 if [ "$home_system" == "true" ]; then
90 if [ "$in_or_out" == "out" ]; then
91 # need the right home machine for modifier when checking out.
92 modifier="svn://shaggy/"
94 # no modifier for checkin.