tasty revision to load feisty for full use
[feisty_meow.git] / scripts / rev_control / getem.sh
1 #!/bin/bash
2
3 # gets any updates for the repository folders present in the REPOSITORY_LIST variable.
4
5 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
6 source "$FEISTY_MEOW_SCRIPTS/rev_control/version_control.sh"
7
8 # trickery to ensure we can always update this file, even when the operating system has some
9 # rude behavior with regard to file locking (ahem, windows...).
10 # and even more rudeness is that the pwd and $TMP may not always be in the same form,
11 # which causes endless confusion and badness.  that's why we get the pwd reading for TMP
12 # first so we can do an orange-to-orange compare.
13 tmpdir="$(cd $TMP; \pwd)"
14 if [ "$(\pwd)" != "$tmpdir" ]; then
15   if [ ! -z "$SHELL_DEBUG" ]; then
16     echo "moving to the TMP directory to avoid file access conflicts..."
17   fi
18   new_name="$TMP/zz_$(basename $0)"
19   cp -f "$0" "$new_name"
20   if [ $? -ne 0 ]; then
21     echo "failed to copy this script up to the TMP directory.  exploit attempted?"
22     exit 1
23   fi
24   cd "$TMP"
25   chmod a+x "$new_name"
26   exec "$new_name"
27 fi
28
29 ##############
30
31 export TMPO_CHK=$TMP/zz_chk.log
32
33 rm -f "$TMPO_CHK"
34
35 echo "getting repositories at: $(date)"
36
37 # perform the checkouts as appropriate per OS.
38 if [ "$OS" != "Windows_NT" ]; then
39   checkout_list $HOME /usr/local 2>&1 | tee -a "$TMPO_CHK"
40 else
41   checkout_list $HOME c:/ d:/ e:/ 2>&1 | tee -a "$TMPO_CHK"
42 fi
43
44 ##############
45
46 # regenerate the scripts after getting latest version of feisty meow.
47 regenerate
48
49 ##############
50