3 # gets any updates for the repository folders present in the REPOSITORY_LIST variable.
5 source "$FEISTY_MEOW_SCRIPTS/core/functions.sh"
6 source "$FEISTY_MEOW_SCRIPTS/rev_control/rev_control.sh"
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..."
18 new_name="$TMP/zz_$(basename $0)"
19 cp -f "$0" "$new_name"
21 echo "failed to copy this script up to the TMP directory. exploit attempted?"
29 # takes out the first few carriage returns that are in the input.
30 function squash_first_few_crs()
42 # if we're still squashing eols, make sure we don't leave them hanging.
47 # selects the checkout method based on where we are (the host the script runs on).
53 cvs update . | squash_first_few_crs
54 elif [ -d ".svn" ]; then
55 svn update . | squash_first_few_crs
56 elif [ -d ".git" ]; then
57 git pull 2>&1 | grep -v "X11 forwarding request failed" | squash_first_few_crs
59 echo unknown repository for $directory...
63 # gets all the updates for a list of folders under revision control.
64 function checkout_list {
67 # turn repo list back into an array.
68 eval "repository_list=( ${REPOSITORY_LIST[*]} )"
69 for j in "${repository_list[@]}"; do
70 # add in the directory for our purposes here.
73 if [ ! -z "$SHELL_DEBUG" ]; then
74 echo "No directory called $j exists."
80 echo -n "retrieving '$j'... "
89 export TMPO_CHK=$TMP/zz_chk.log
93 echo "Getting repositories at: $(date)"
95 # perform the checkouts as appropriate per OS.
96 if [ "$OS" != "Windows_NT" ]; then
97 checkout_list $HOME 2>&1 | tee -a "$TMPO_CHK"
99 checkout_list $HOME c:/ d:/ e:/ 2>&1 | tee -a "$TMPO_CHK"
104 # we now regenerate the scripts after getme, to ensure it's done automatically.
105 bash "$FEISTY_MEOW_SCRIPTS/core/bootstrap_shells.sh"
106 perl "$FEISTY_MEOW_SCRIPTS/core/generate_aliases.pl"