modified error handling methods
authorChris Koeritz <fred@gruntose.com>
Sat, 19 May 2018 20:03:13 +0000 (16:03 -0400)
committerChris Koeritz <fred@gruntose.com>
Sat, 19 May 2018 20:03:13 +0000 (16:03 -0400)
test_or_die => exit_on_error
test_or_continue => continue_on_error

35 files changed:
scripts/archival/serene_backer_upper.sh
scripts/buildor/refresh_gffs_build.sh
scripts/core/functions.sh
scripts/customize/developer/scripts/redeveloper.sh
scripts/customize/fred/scripts/email/filter_grabber.sh
scripts/customize/fred/scripts/games/fallout_new_vegas_link_fixer.sh
scripts/customize/fred/scripts/games/gamesaver.sh
scripts/customize/fred/scripts/refred.sh
scripts/rev_control/checkin.sh
scripts/rev_control/compact_git.sh
scripts/rev_control/diff_repos.sh
scripts/rev_control/getem.sh
scripts/rev_control/puffer.sh
scripts/rev_control/push_repo_downstream.sh
scripts/rev_control/rcheckin.sh
scripts/rev_control/report_new.sh
scripts/rev_control/resolve_svn.sh
scripts/rev_control/rgetem.sh
scripts/rev_control/rpuffer.sh
scripts/rev_control/version_control.sh
scripts/security/cool_permissionator.sh
scripts/security/password_functions.sh
scripts/site_avenger/avcoreup.sh
scripts/site_avenger/clean_mapsdemo.sh
scripts/site_avenger/powerup.sh
scripts/site_avenger/revamp_cakelampvm_v002.sh
scripts/site_avenger/revamp_cakelampvm_v003.sh
scripts/site_avenger/shared_site_mgr.sh
scripts/site_avenger/sitepush.sh
scripts/site_avenger/siteup.sh
scripts/site_avenger/standup.sh
scripts/site_avenger/teardown.sh
scripts/system/add_swap_mount.sh
scripts/system/common_sysadmin.sh
scripts/system/naive_system_updater.sh

index 8a8526016877c3b61a12b1078787cad653330306..2092f2f8852719c1afd09fe8b6a2b43ad1b30db1 100644 (file)
@@ -15,7 +15,7 @@ function synch_to_backup()
   fi
   echo "Synchronizing $source into $dest."
   synch_files "$source" "$dest"
   fi
   echo "Synchronizing $source into $dest."
   synch_files "$source" "$dest"
-  test_or_continue "synching $source to $dest"
+  continue_on_error "synching $source to $dest"
 }
 
 ##############
 }
 
 ##############
@@ -27,12 +27,12 @@ function synch_to_backup()
 
 # now saddle up the backup.
 #NO LONGER USING MOUNT: mount /z/backup/
 
 # now saddle up the backup.
 #NO LONGER USING MOUNT: mount /z/backup/
-#NO LONGER USING MOUNT: test_or_die "mounting backup folder"
+#NO LONGER USING MOUNT: exit_on_error "mounting backup folder"
 
 # we should always be synching to an existing set in there.  make sure they exist.
 # for the first ever backup, this is not a good check...
 #test -d /z/backup/etc -a -d /z/backup/home
 
 # we should always be synching to an existing set in there.  make sure they exist.
 # for the first ever backup, this is not a good check...
 #test -d /z/backup/etc -a -d /z/backup/home
-#test_or_die "testing presence of prior backup"
+#exit_on_error "testing presence of prior backup"
 
 ##############
 
 
 ##############
 
@@ -52,6 +52,6 @@ synch_to_backup /var/lib/mysql /z/backup/var/lib/mysql
 ##############
 
 #NO LONGER USING MOUNT: umount /z/backup/
 ##############
 
 #NO LONGER USING MOUNT: umount /z/backup/
-#NO LONGER USING MOUNT: test_or_die "unmounting backup folder"
+#NO LONGER USING MOUNT: exit_on_error "unmounting backup folder"
 
 
 
 
index dc255929e3040cfdda487e515257f33ac6e0b715..66f1028e480f5c3288d0a03dc0e99b6e4c009516 100644 (file)
@@ -14,12 +14,12 @@ echo cleaning out the logs directory...
 echo making a simple starting log file for container...
 if [ ! -d "$GFFS_LOGS" ]; then
   mkdir -p "$GFFS_LOGS"
 echo making a simple starting log file for container...
 if [ ! -d "$GFFS_LOGS" ]; then
   mkdir -p "$GFFS_LOGS"
-  test_or_die Making GFFS logs directory.
+  exit_on_error Making GFFS logs directory.
 fi
 
 echo building the code freshly, although not with a clean first...
 build_gffs 
 fi
 
 echo building the code freshly, although not with a clean first...
 build_gffs 
-test_or_die Building GFFS source code.
+exit_on_error Building GFFS source code.
 
 echo starting container now and spooling its log file...
 (bash $GFFS_TOOLKIT_ROOT/library/maybe_restart_container.sh &>$TMP/main_container_restarting.log & )
 
 echo starting container now and spooling its log file...
 (bash $GFFS_TOOLKIT_ROOT/library/maybe_restart_container.sh &>$TMP/main_container_restarting.log & )
index f708fe852778792cdb1b022d345bfb0f936b7b67..fc5ce4ebc677daf6270acb850cda42688c803eaf 100644 (file)
@@ -141,7 +141,7 @@ if [ -z "$skip_all" ]; then
   # checks the result of the last command that was run, and if that failed,
   # then this complains and exits from bash.  the function parameters are
   # used as the message to print as a complaint.
   # checks the result of the last command that was run, and if that failed,
   # then this complains and exits from bash.  the function parameters are
   # used as the message to print as a complaint.
-  function test_or_die()
+  function exit_on_error()
   {
     if [ $? -ne 0 ]; then
       echo -e "\n\naction failed: $*\n\n*** Exiting script..."
   {
     if [ $? -ne 0 ]; then
       echo -e "\n\naction failed: $*\n\n*** Exiting script..."
@@ -150,8 +150,8 @@ if [ -z "$skip_all" ]; then
     fi
   }
 
     fi
   }
 
-  # like test_or_die, but will keep going after complaining.
-  function test_or_continue()
+  # like exit_on_error, but will keep going after complaining.
+  function continue_on_error()
   {
     if [ $? -ne 0 ]; then
       echo -e "\n\nerror occurred: $*\n\n=> Continuing script..."
   {
     if [ $? -ne 0 ]; then
       echo -e "\n\nerror occurred: $*\n\n=> Continuing script..."
@@ -484,7 +484,7 @@ if [ -z "$skip_all" ]; then
 #hmmm: better yet actually, just don't complain on freaking cygwin, since that's where this happens
     chown -R "$(logname):$(logname)" \
         "$FEISTY_MEOW_LOADING_DOCK"/* "$FEISTY_MEOW_GENERATED_STORE"/* 2>/dev/null
 #hmmm: better yet actually, just don't complain on freaking cygwin, since that's where this happens
     chown -R "$(logname):$(logname)" \
         "$FEISTY_MEOW_LOADING_DOCK"/* "$FEISTY_MEOW_GENERATED_STORE"/* 2>/dev/null
-    test_or_continue "chowning to $(logname) didn't happen."
+    continue_on_error "chowning to $(logname) didn't happen."
 
     regenerate >/dev/null
     pushd "$FEISTY_MEOW_LOADING_DOCK/custom" &>/dev/null
 
     regenerate >/dev/null
     pushd "$FEISTY_MEOW_LOADING_DOCK/custom" &>/dev/null
@@ -501,19 +501,19 @@ or if you're on cygwin, then try this (if apt-cyg is available):\n
     if [ ${#incongruous_files} -ge 2 ]; then
       echo "cleaning unknown older overrides..."
       perl "$FEISTY_MEOW_SCRIPTS/files/safedel.pl" $incongruous_files
     if [ ${#incongruous_files} -ge 2 ]; then
       echo "cleaning unknown older overrides..."
       perl "$FEISTY_MEOW_SCRIPTS/files/safedel.pl" $incongruous_files
-      test_or_continue "running safedel.  $fail_message" 
+      continue_on_error "running safedel.  $fail_message" 
       echo
     fi
     popd &>/dev/null
     echo "copying custom overrides for $custom_user"
     mkdir -p "$FEISTY_MEOW_LOADING_DOCK/custom" 2>/dev/null
     perl "$FEISTY_MEOW_SCRIPTS/text/cpdiff.pl" "$FEISTY_MEOW_SCRIPTS/customize/$custom_user" "$FEISTY_MEOW_LOADING_DOCK/custom"
       echo
     fi
     popd &>/dev/null
     echo "copying custom overrides for $custom_user"
     mkdir -p "$FEISTY_MEOW_LOADING_DOCK/custom" 2>/dev/null
     perl "$FEISTY_MEOW_SCRIPTS/text/cpdiff.pl" "$FEISTY_MEOW_SCRIPTS/customize/$custom_user" "$FEISTY_MEOW_LOADING_DOCK/custom"
-    test_or_continue "running cpdiff.  $fail_message"
+    continue_on_error "running cpdiff.  $fail_message"
 
     if [ -d "$FEISTY_MEOW_SCRIPTS/customize/$custom_user/scripts" ]; then
       echo "copying custom scripts for $custom_user"
       rsync -avz "$FEISTY_MEOW_SCRIPTS/customize/$custom_user/scripts" "$FEISTY_MEOW_LOADING_DOCK/custom/" &>/dev/null
 
     if [ -d "$FEISTY_MEOW_SCRIPTS/customize/$custom_user/scripts" ]; then
       echo "copying custom scripts for $custom_user"
       rsync -avz "$FEISTY_MEOW_SCRIPTS/customize/$custom_user/scripts" "$FEISTY_MEOW_LOADING_DOCK/custom/" &>/dev/null
-      test_or_continue "copying customization scripts"
+      continue_on_error "copying customization scripts"
 #hmmm: could save output to show if an error occurs.
     fi
     echo
 #hmmm: could save output to show if an error occurs.
     fi
     echo
@@ -522,7 +522,7 @@ or if you're on cygwin, then try this (if apt-cyg is available):\n
     # prevent permission foul-ups, again.
     chown -R "$(logname):$(logname)" \
         "$FEISTY_MEOW_LOADING_DOCK" "$FEISTY_MEOW_GENERATED_STORE" 2>/dev/null
     # prevent permission foul-ups, again.
     chown -R "$(logname):$(logname)" \
         "$FEISTY_MEOW_LOADING_DOCK" "$FEISTY_MEOW_GENERATED_STORE" 2>/dev/null
-    test_or_continue "chowning to $(logname) didn't happen."
+    continue_on_error "chowning to $(logname) didn't happen."
 
     restore_terminal_title
   }
 
     restore_terminal_title
   }
@@ -803,7 +803,7 @@ return 0
   
     if [ -d "$src" ]; then
       ln -s "$src" "$target"
   
     if [ -d "$src" ]; then
       ln -s "$src" "$target"
-      test_or_die "Creating symlink from '$src' to '$target'"
+      exit_on_error "Creating symlink from '$src' to '$target'"
     fi
     echo "Created symlink from '$src' to '$target'."
   }
     fi
     echo "Created symlink from '$src' to '$target'."
   }
@@ -820,7 +820,7 @@ return 0
       temp_out="$TMP/$file.view"
       cat "$file" | python -m json.tool > "$temp_out"
       show_list+=($temp_out)
       temp_out="$TMP/$file.view"
       cat "$file" | python -m json.tool > "$temp_out"
       show_list+=($temp_out)
-      test_or_continue "pretty printing '$file'"
+      continue_on_error "pretty printing '$file'"
     done
     filedump "${show_list[@]}"
     rm "${show_list[@]}"
     done
     filedump "${show_list[@]}"
     rm "${show_list[@]}"
@@ -881,12 +881,12 @@ return 0
 
     # make a backup first, oy.
     \cp -f "$filename" "/tmp/$(basename ${filename}).bkup-${RANDOM}" 
 
     # make a backup first, oy.
     \cp -f "$filename" "/tmp/$(basename ${filename}).bkup-${RANDOM}" 
-    test_or_die "backing up file: $filename"
+    exit_on_error "backing up file: $filename"
 
     # make a temp file to write to before we move file into place in bind.
     local new_version="/tmp/$(basename ${filename}).bkup-${RANDOM}" 
     \rm -f "$new_version"
 
     # make a temp file to write to before we move file into place in bind.
     local new_version="/tmp/$(basename ${filename}).bkup-${RANDOM}" 
     \rm -f "$new_version"
-    test_or_die "cleaning out new version of file from: $new_version"
+    exit_on_error "cleaning out new version of file from: $new_version"
 
     local line
     local skip_count=0
 
     local line
     local skip_count=0
@@ -921,7 +921,7 @@ return 0
     if [ ! -z "$found_any" ]; then
       # put the file back into place under the original name.
       \mv "$new_version" "$filename"
     if [ ! -z "$found_any" ]; then
       # put the file back into place under the original name.
       \mv "$new_version" "$filename"
-      test_or_die "moving the new version into place in: $filename"
+      exit_on_error "moving the new version into place in: $filename"
     else
       # cannot always be considered an error, but we can at least gripe.
       echo "Did not find any matches for seeker '$seeker' in file: $filename"
     else
       # cannot always be considered an error, but we can at least gripe.
       echo "Did not find any matches for seeker '$seeker' in file: $filename"
@@ -957,7 +957,7 @@ return 0
     echo running tests on set_var_if_undefined.
     flagrant=petunia
     set_var_if_undefined flagrant forknordle
     echo running tests on set_var_if_undefined.
     flagrant=petunia
     set_var_if_undefined flagrant forknordle
-    test_or_die "testing if defined variable would be whacked"
+    exit_on_error "testing if defined variable would be whacked"
     if [ $flagrant != petunia ]; then
       echo set_var_if_undefined failed to leave the test variable alone
       exit 1
     if [ $flagrant != petunia ]; then
       echo set_var_if_undefined failed to leave the test variable alone
       exit 1
index eeb0fbcbe31375791d1da99383b4ec7b65ada816..85f6e28c855eab74afd0f6d032c5294f8bcf2826 100644 (file)
@@ -11,10 +11,10 @@ function do_redeveloper()
 # than when it's just being sourced.
 if [[ $0 =~ .*redeveloper\.sh.* ]]; then
   source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
 # than when it's just being sourced.
 if [[ $0 =~ .*redeveloper\.sh.* ]]; then
   source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
-  test_or_die "sourcing the feisty meow environment"
+  exit_on_error "sourcing the feisty meow environment"
   source "$FEISTY_MEOW_SCRIPTS/security/cool_permissionator.sh"
   source "$FEISTY_MEOW_SCRIPTS/security/cool_permissionator.sh"
-  test_or_die "sourcing the permission script"
+  exit_on_error "sourcing the permission script"
   do_redeveloper
   do_redeveloper
-  test_or_die "redevelopering process"
+  exit_on_error "redevelopering process"
 fi
 
 fi
 
index 1889b2fe72c00f96987fef227c9b373903dea3bf..dcb794644d053c17003c79fcee5c230f26bbba31 100644 (file)
@@ -5,9 +5,9 @@
 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
 
 cp $HOME/.thunderbird/oqv30zg4.default/ImapMail/zooty.koeritz.com/msgFilterRules.dat $CLOUD_BASE/magic_cabinet/mail_filters/zooty_serene_hamstertronic_$(date_stringer).filters
 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
 
 cp $HOME/.thunderbird/oqv30zg4.default/ImapMail/zooty.koeritz.com/msgFilterRules.dat $CLOUD_BASE/magic_cabinet/mail_filters/zooty_serene_hamstertronic_$(date_stringer).filters
-test_or_die "copying feistymeow.org filters"
+exit_on_error "copying feistymeow.org filters"
 
 cp $HOME/.thunderbird/oqv30zg4.default/ImapMail/mail.eservices.virginia.edu/msgFilterRules.dat $CLOUD_BASE/magic_cabinet/mail_filters/uva_email_$(date_stringer).filters 
 
 cp $HOME/.thunderbird/oqv30zg4.default/ImapMail/mail.eservices.virginia.edu/msgFilterRules.dat $CLOUD_BASE/magic_cabinet/mail_filters/uva_email_$(date_stringer).filters 
-test_or_die "copying UVa filters"
+exit_on_error "copying UVa filters"
 
 
 
 
index a9a8ed82a69f22aa897b8466823bd1a740e88915..2475b432a3b62cd89f5b2259f5c10a71b82f80e8 100644 (file)
@@ -31,7 +31,7 @@ function make_local_dir_link()
     return
   fi
   ln -s "$name" "$new_name"
     return
   fi
   ln -s "$name" "$new_name"
-  test_or_die "creating link for $dir/$new_name from $dir/$name"
+  exit_on_error "creating link for $dir/$new_name from $dir/$name"
   echo "Created link $dir/$new_name from $dir/$name"
   popd &>/dev/null
 }
   echo "Created link $dir/$new_name from $dir/$name"
   popd &>/dev/null
 }
index 80cdfd98327919c4ea1052412550551901953fad..dc6956ec10e3ef467b97817264496f1c1395ee7a 100644 (file)
@@ -20,7 +20,7 @@ fi
 
 if [ ! -d "$SPOOLING_OUTPUT_DIR" ]; then
   mkdir -p "$SPOOLING_OUTPUT_DIR"
 
 if [ ! -d "$SPOOLING_OUTPUT_DIR" ]; then
   mkdir -p "$SPOOLING_OUTPUT_DIR"
-  test_or_die Creating spooling output directory.
+  exit_on_error Creating spooling output directory.
 fi
 
 # copies the files for a particular game out to a spooling folder.
 fi
 
 # copies the files for a particular game out to a spooling folder.
index a026b4c61babde3aafc9a13214f3b0d80c76f492..65f9c35c7d5513bf75486bd71d1fe36db0f24724 100644 (file)
@@ -11,10 +11,10 @@ function do_refred()
 # than when it's just being sourced.
 if [[ $0 =~ .*refred\.sh.* ]]; then
   source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
 # than when it's just being sourced.
 if [[ $0 =~ .*refred\.sh.* ]]; then
   source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
-  test_or_die "sourcing the feisty meow environment"
+  exit_on_error "sourcing the feisty meow environment"
   source "$FEISTY_MEOW_SCRIPTS/security/cool_permissionator.sh"
   source "$FEISTY_MEOW_SCRIPTS/security/cool_permissionator.sh"
-  test_or_die "sourcing the permission script"
+  exit_on_error "sourcing the permission script"
   do_refred
   do_refred
-  test_or_die "refredding process"
+  exit_on_error "refredding process"
 fi
 
 fi
 
index 5b126d9a73762c5e482ff63c73fb960d6efde646..9bdbe5cf10534452b2aa38a6ae6a63a4b682bb81 100644 (file)
@@ -16,7 +16,7 @@ if [ "$OS" == "Windows_NT" ]; then
 fi
 
 checkin_list $FULL_LIST
 fi
 
 checkin_list $FULL_LIST
-test_or_die "checking in list: $FULL_LIST"
+exit_on_error "checking in list: $FULL_LIST"
 
 ##############
 
 
 ##############
 
index c1a22ef0b5c45d41cfcddd3764aa61ed88a97d5d..5d32cc6d7617cbabee79327f1f4ec27250f2f6e2 100644 (file)
@@ -12,18 +12,18 @@ if [ -z "$prune_dir" ]; then
   prune_dir="$(pwd)"
 fi
 pushd "$prune_dir" &>/dev/null
   prune_dir="$(pwd)"
 fi
 pushd "$prune_dir" &>/dev/null
-test_or_die "changing to directory: $prune_dir"
+exit_on_error "changing to directory: $prune_dir"
 
 echo "cleaning git repo in directory $(pwd)"
 
 git fsck --full
 
 echo "cleaning git repo in directory $(pwd)"
 
 git fsck --full
-test_or_die "git fsck"
+exit_on_error "git fsck"
 
 git gc --prune=today --aggressive
 
 git gc --prune=today --aggressive
-test_or_die "git gc"
+exit_on_error "git gc"
 
 git repack
 
 git repack
-test_or_die "git repack"
+exit_on_error "git repack"
 
 popd &>/dev/null
 
 
 popd &>/dev/null
 
index eb02719e047811eb6cdb44cfeb13185b66a5b6c6..c0d01e518a514a6d13ac932d03601488d6e934d1 100644 (file)
@@ -16,10 +16,10 @@ if [ -z "$dir" ]; then
 fi
 
 pushd "$dir" &>/dev/null
 fi
 
 pushd "$dir" &>/dev/null
-test_or_die "changing to directory: $dir"
+exit_on_error "changing to directory: $dir"
 tempfile=$(generate_rev_ctrl_filelist)
 popd &>/dev/null
 
 perform_revctrl_action_on_file "$tempfile" do_diff
 tempfile=$(generate_rev_ctrl_filelist)
 popd &>/dev/null
 
 perform_revctrl_action_on_file "$tempfile" do_diff
-test_or_die "performing revision control action do_diff on: $tempfile"
+exit_on_error "performing revision control action do_diff on: $tempfile"
 
 
index e7aeabc6588407406ce7684d6bff079f1e0de716..da9cb3913482df743d2d664f28de0d32a8c1e842 100644 (file)
@@ -20,13 +20,13 @@ if [ "$(\pwd)" != "$tmpdir" ]; then
   fi
   new_name="$TMP/zz_$(basename $0)"
   \cp -f "$0" "$new_name"
   fi
   new_name="$TMP/zz_$(basename $0)"
   \cp -f "$0" "$new_name"
-  test_or_die "failed to copy this script up to the TMP directory.  exploit attempted?"
+  exit_on_error "failed to copy this script up to the TMP directory.  exploit attempted?"
   pushd "$TMP" &>/dev/null
   pushd "$TMP" &>/dev/null
-  test_or_die "changing to TMP directory: $TMP"
+  exit_on_error "changing to TMP directory: $TMP"
   chmod a+x "$new_name"
   chmod a+x "$new_name"
-  test_or_die "chmodding of file: $new_name"
+  exit_on_error "chmodding of file: $new_name"
   exec "$new_name"
   exec "$new_name"
-  test_or_die "execing cloned getemscript"
+  exit_on_error "execing cloned getemscript"
   popd &>/dev/null
 fi
 
   popd &>/dev/null
 fi
 
@@ -35,7 +35,7 @@ fi
 export TMPO_CHK=$TMP/zz_chk.log
 
 rm -f "$TMPO_CHK"
 export TMPO_CHK=$TMP/zz_chk.log
 
 rm -f "$TMPO_CHK"
-test_or_die "removing file: $TMPO_CHK"
+exit_on_error "removing file: $TMPO_CHK"
 
 echo "getting repositories at: $(date)"
 echo
 
 echo "getting repositories at: $(date)"
 echo
@@ -46,7 +46,7 @@ if [ "$OS" == "Windows_NT" ]; then
   FULL_LIST+="c:/ d:/ e:/"
 fi
 checkout_list $FULL_LIST 2>&1 | tee -a "$TMPO_CHK"
   FULL_LIST+="c:/ d:/ e:/"
 fi
 checkout_list $FULL_LIST 2>&1 | tee -a "$TMPO_CHK"
-test_or_die "checking out list: $FULL_LIST"
+exit_on_error "checking out list: $FULL_LIST"
 
 ##############
 
 
 ##############
 
index c02ef3bce96edcfbaf1676ad125d9251108f268d..27ab4d332ff95f578a13e8f2b85bf51223fcaf22 100644 (file)
@@ -20,7 +20,7 @@ if [ "$OS" == "Windows_NT" ]; then
 fi
 
 puff_out_list $FULL_LIST
 fi
 
 puff_out_list $FULL_LIST
-test_or_die "puffing out list: $FULL_LIST"
+exit_on_error "puffing out list: $FULL_LIST"
 
 ##############
 
 
 ##############
 
index d65c2f45bfab643ba13f86bd489eb58cbfb7a8b3..281cc7e9e8ea917a21b0ccd6cfc4d3bf85b0ac4b 100644 (file)
@@ -44,21 +44,21 @@ if [ -z "$dir" ]; then
 fi
 
 pushd "$dir" &>/dev/null
 fi
 
 pushd "$dir" &>/dev/null
-test_or_die "changing to directory: $dir"
+exit_on_error "changing to directory: $dir"
 tempfile=$(generate_rev_ctrl_filelist)
 tempfile=$(generate_rev_ctrl_filelist)
-test_or_die "generating revision control file list"
+exit_on_error "generating revision control file list"
 
 perform_revctrl_action_on_file "$tempfile" do_careful_git_update
 
 perform_revctrl_action_on_file "$tempfile" do_careful_git_update
-test_or_die "doing a careful update on: $tempfile"
+exit_on_error "doing a careful update on: $tempfile"
 
 # seems to be needed to cause a merge to be resolved.
 git pull downstream master
 # -m "unfortunate merge"
 
 # seems to be needed to cause a merge to be resolved.
 git pull downstream master
 # -m "unfortunate merge"
-test_or_die "running the git pull downstream master"
+exit_on_error "running the git pull downstream master"
 
 # send our little boat down the stream to the dependent repository.
 git push --tags downstream master
 
 # send our little boat down the stream to the dependent repository.
 git push --tags downstream master
-test_or_die "running the git push downstream master"
+exit_on_error "running the git push downstream master"
 
 popd &>/dev/null
 
 
 popd &>/dev/null
 
index 1c5400fb8562105a439673c01efc0136652e8871..268bed815d110951a207c85df95ab75ec2b22f42 100644 (file)
@@ -15,11 +15,11 @@ if [ -z "$dir" ]; then
 fi
 
 pushd "$dir" &>/dev/null
 fi
 
 pushd "$dir" &>/dev/null
-test_or_die "changing to directory: $dir"
+exit_on_error "changing to directory: $dir"
 tempfile=$(generate_rev_ctrl_filelist)
 tempfile=$(generate_rev_ctrl_filelist)
-test_or_die "generating revision control file list"
+exit_on_error "generating revision control file list"
 popd &>/dev/null
 
 perform_revctrl_action_on_file "$tempfile" do_checkin
 popd &>/dev/null
 
 perform_revctrl_action_on_file "$tempfile" do_checkin
-test_or_die "doing a check-in on: $tempfile"
+exit_on_error "doing a check-in on: $tempfile"
 
 
index e51e90c79b2fe436045c7c2c25074aab21240060..c2f3a032e398ca30b7356fe973e57e92bd2efe11 100644 (file)
@@ -16,11 +16,11 @@ if [ -z "$dir" ]; then
 fi
 
 pushd "$dir" &>/dev/null
 fi
 
 pushd "$dir" &>/dev/null
-test_or_die "changing directory to: $dir"
+exit_on_error "changing directory to: $dir"
 tempfile=$(generate_rev_ctrl_filelist)
 tempfile=$(generate_rev_ctrl_filelist)
-test_or_die "generating revision control file list"
+exit_on_error "generating revision control file list"
 popd &>/dev/null
 
 perform_revctrl_action_on_file "$tempfile" do_report_new
 popd &>/dev/null
 
 perform_revctrl_action_on_file "$tempfile" do_report_new
-test_or_die "running revision control report"
+exit_on_error "running revision control report"
 
 
index b75979738722604de485d217b321a6dc64104009..e1d4913a8d78c290c1c4ee91423f955b9226fe17 100644 (file)
@@ -16,6 +16,6 @@ if [ -z "$filename" ]; then
 fi
 
 svn resolve --accept=working "$filename"
 fi
 
 svn resolve --accept=working "$filename"
-test_or_die "resolving tree conflict by accepting the working directory as the right one"
+exit_on_error "resolving tree conflict by accepting the working directory as the right one"
 
 
 
 
index 4c29c03863912887cf0e7b356fa6c7fdec437856..eeb86f70b4f77dfc2257cfaf30b5028adcd75750 100644 (file)
@@ -15,11 +15,11 @@ if [ -z "$dir" ]; then
 fi
 
 pushd "$dir" &>/dev/null
 fi
 
 pushd "$dir" &>/dev/null
-test_or_die "changing to directory: $dir"
+exit_on_error "changing to directory: $dir"
 tempfile=$(generate_rev_ctrl_filelist)
 tempfile=$(generate_rev_ctrl_filelist)
-test_or_die "generating revision control file list"
+exit_on_error "generating revision control file list"
 popd &>/dev/null
 
 perform_revctrl_action_on_file "$tempfile" do_update
 popd &>/dev/null
 
 perform_revctrl_action_on_file "$tempfile" do_update
-test_or_die "running revision control update"
+exit_on_error "running revision control update"
 
 
index 5032bc12f1cbbcaf0e8aff4fd6fd91d047dc5541..0cb0345ca7596193e637e063ba9d2d6cf8345e06 100644 (file)
@@ -19,11 +19,11 @@ if [ -z "$dir" ]; then
 fi
 
 pushd "$dir" &>/dev/null
 fi
 
 pushd "$dir" &>/dev/null
-test_or_die "changing to directory: $dir"
+exit_on_error "changing to directory: $dir"
 tempfile=$(generate_rev_ctrl_filelist)
 tempfile=$(generate_rev_ctrl_filelist)
-test_or_die "generating revision control file list"
+exit_on_error "generating revision control file list"
 popd &>/dev/null
 
 perform_revctrl_action_on_file "$tempfile" do_careful_git_update
 popd &>/dev/null
 
 perform_revctrl_action_on_file "$tempfile" do_careful_git_update
-test_or_die "puffing out repository at: $tempfile"
+exit_on_error "puffing out repository at: $tempfile"
 
 
index 0c7ac401b6305cc595e4e7eedea2728c0f55b9d3..f7dcb7973d90a7d5f6473c6671a45fad4f8f93f6 100644 (file)
@@ -84,7 +84,7 @@ function do_checkin()
   local blatt="echo -n checking in '$nicedir'...  "
 
   do_update "$directory"
   local blatt="echo -n checking in '$nicedir'...  "
 
   do_update "$directory"
-  test_or_die "repository update--this should be fixed before check-in."
+  exit_on_error "repository update--this should be fixed before check-in."
 
   pushd "$directory" &>/dev/null
   if [ -f ".no-checkin" ]; then
 
   pushd "$directory" &>/dev/null
   if [ -f ".no-checkin" ]; then
@@ -93,13 +93,13 @@ function do_checkin()
     if test_writeable "CVS"; then
       $blatt
       cvs ci .
     if test_writeable "CVS"; then
       $blatt
       cvs ci .
-      test_or_die "cvs checkin"
+      exit_on_error "cvs checkin"
     fi
   elif [ -d ".svn" ]; then
     if test_writeable ".svn"; then
       $blatt
       svn ci .
     fi
   elif [ -d ".svn" ]; then
     if test_writeable ".svn"; then
       $blatt
       svn ci .
-      test_or_die "svn checkin"
+      exit_on_error "svn checkin"
     fi
   elif [ -d ".git" ]; then
     if test_writeable ".git"; then
     fi
   elif [ -d ".git" ]; then
     if test_writeable ".git"; then
@@ -108,7 +108,7 @@ function do_checkin()
       # put all changed and new files in the commit.  not to everyone's liking.
       git add --all . | $TO_SPLITTER
       promote_pipe_return 0
       # put all changed and new files in the commit.  not to everyone's liking.
       git add --all . | $TO_SPLITTER
       promote_pipe_return 0
-      test_or_die "git add all new files"
+      exit_on_error "git add all new files"
 
       # see if there are any changes in the local repository.
       if ! git diff-index --quiet HEAD --; then
 
       # see if there are any changes in the local repository.
       if ! git diff-index --quiet HEAD --; then
@@ -116,7 +116,7 @@ function do_checkin()
 #hmmm: begins to look like, you guessed it, a reusable bit that all commit actions could enjoy.
         git commit .
         retval=$?
 #hmmm: begins to look like, you guessed it, a reusable bit that all commit actions could enjoy.
         git commit .
         retval=$?
-        test_or_continue "git commit"
+        continue_on_error "git commit"
         if [ $retval -ne 0 ]; then
           echo -e -n "Commit failed or was aborted:\nShould we continue with other check-ins? [y/N] "
           local line
         if [ $retval -ne 0 ]; then
           echo -e -n "Commit failed or was aborted:\nShould we continue with other check-ins? [y/N] "
           local line
@@ -137,7 +137,7 @@ function do_checkin()
       # upload any changes to the upstream repo so others can see them.
       git push --tags origin "$(my_branch_name)" 2>&1 | grep -v "X11 forwarding request failed" | $TO_SPLITTER
       promote_pipe_return 0
       # upload any changes to the upstream repo so others can see them.
       git push --tags origin "$(my_branch_name)" 2>&1 | grep -v "X11 forwarding request failed" | $TO_SPLITTER
       promote_pipe_return 0
-      test_or_die "git push"
+      exit_on_error "git push"
 
     fi
   else
 
     fi
   else
@@ -163,13 +163,13 @@ function do_diff
   # only update if we see a repository living there.
   if [ -d ".svn" ]; then
     svn diff .
   # only update if we see a repository living there.
   if [ -d ".svn" ]; then
     svn diff .
-    test_or_die "subversion diff"
+    exit_on_error "subversion diff"
   elif [ -d ".git" ]; then
     git diff 
   elif [ -d ".git" ]; then
     git diff 
-    test_or_die "git diff"
+    exit_on_error "git diff"
   elif [ -d "CVS" ]; then
     cvs diff .
   elif [ -d "CVS" ]; then
     cvs diff .
-    test_or_die "cvs diff"
+    exit_on_error "cvs diff"
   fi
 
   popd &>/dev/null
   fi
 
   popd &>/dev/null
@@ -194,10 +194,10 @@ function do_report_new
   elif [ -d ".svn" ]; then
     # this action so far only makes sense and is needed for svn.
     bash $FEISTY_MEOW_SCRIPTS/rev_control/svnapply.sh \? echo
   elif [ -d ".svn" ]; then
     # this action so far only makes sense and is needed for svn.
     bash $FEISTY_MEOW_SCRIPTS/rev_control/svnapply.sh \? echo
-    test_or_die "svn diff"
+    exit_on_error "svn diff"
   elif [ -d ".git" ]; then
     git status -u
   elif [ -d ".git" ]; then
     git status -u
-    test_or_die "git status -u"
+    exit_on_error "git status -u"
   fi
 
   popd &>/dev/null
   fi
 
   popd &>/dev/null
@@ -226,7 +226,7 @@ function checkin_list()
       # yep, this path is absolute.  just handle it directly.
       if [ ! -d "$outer" ]; then continue; fi
       do_checkin "$outer"
       # yep, this path is absolute.  just handle it directly.
       if [ ! -d "$outer" ]; then continue; fi
       do_checkin "$outer"
-      test_or_die "running check-in (absolute) on path: $outer"
+      exit_on_error "running check-in (absolute) on path: $outer"
       sep 28
     else
       for inner in $list; do
       sep 28
     else
       for inner in $list; do
@@ -234,7 +234,7 @@ function checkin_list()
         local path="$inner/$outer"
         if [ ! -d "$path" ]; then continue; fi
         do_checkin "$path"
         local path="$inner/$outer"
         if [ ! -d "$path" ]; then continue; fi
         do_checkin "$path"
-        test_or_die "running check-in (relative) on path: $path"
+        exit_on_error "running check-in (relative) on path: $path"
         sep 28
       done
     fi
         sep 28
       done
     fi
@@ -266,7 +266,7 @@ function puff_out_list()
       # yep, this path is absolute.  just handle it directly.
       if [ ! -d "$outer" ]; then continue; fi
       do_careful_git_update "$outer"
       # yep, this path is absolute.  just handle it directly.
       if [ ! -d "$outer" ]; then continue; fi
       do_careful_git_update "$outer"
-      test_or_die "running puff-out (absolute) on path: $outer"
+      exit_on_error "running puff-out (absolute) on path: $outer"
       sep 28
     else
       for inner in $list; do
       sep 28
     else
       for inner in $list; do
@@ -274,7 +274,7 @@ function puff_out_list()
         local path="$inner/$outer"
         if [ ! -d "$path" ]; then continue; fi
         do_careful_git_update "$path"
         local path="$inner/$outer"
         if [ ! -d "$path" ]; then continue; fi
         do_careful_git_update "$path"
-        test_or_die "running puff-out (relative) on path: $path"
+        exit_on_error "running puff-out (relative) on path: $path"
         sep 28
       done
     fi
         sep 28
       done
     fi
@@ -379,7 +379,7 @@ function do_careful_git_update()
 {
   local directory="$1"; shift
   pushd "$directory" &>/dev/null
 {
   local directory="$1"; shift
   pushd "$directory" &>/dev/null
-  test_or_die "changing to directory: $directory"
+  exit_on_error "changing to directory: $directory"
 
   if [ ! -d ".git" ]; then
 
 
   if [ ! -d ".git" ]; then
 
@@ -400,7 +400,7 @@ function do_careful_git_update()
   # first update all our remote branches to their current state from the repos.
   git remote update | $TO_SPLITTER
   promote_pipe_return 0
   # first update all our remote branches to their current state from the repos.
   git remote update | $TO_SPLITTER
   promote_pipe_return 0
-  test_or_die "git remote update"
+  exit_on_error "git remote update"
 
   show_branch_conditionally "$this_branch"
 
 
   show_branch_conditionally "$this_branch"
 
@@ -413,7 +413,7 @@ function do_careful_git_update()
 #    echo "synchronizing remote branch: $bran"
     git checkout "$bran" | $TO_SPLITTER
     promote_pipe_return 0
 #    echo "synchronizing remote branch: $bran"
     git checkout "$bran" | $TO_SPLITTER
     promote_pipe_return 0
-    test_or_die "git switching checkout to remote branch: $bran"
+    exit_on_error "git switching checkout to remote branch: $bran"
 
     show_branch_conditionally "$this_branch"
 
 
     show_branch_conditionally "$this_branch"
 
@@ -425,12 +425,12 @@ function do_careful_git_update()
 # without any changes in them.  --no-ff
       promote_pipe_return 0
     fi
 # without any changes in them.  --no-ff
       promote_pipe_return 0
     fi
-    test_or_die "git pull of remote branch: $bran"
+    exit_on_error "git pull of remote branch: $bran"
   done
   # now switch back to our branch.
   git checkout "$this_branch" | $TO_SPLITTER
   promote_pipe_return 0
   done
   # now switch back to our branch.
   git checkout "$this_branch" | $TO_SPLITTER
   promote_pipe_return 0
-  test_or_die "git checking out our current branch: $this_branch"
+  exit_on_error "git checking out our current branch: $this_branch"
 
   # now pull down any changes in our own origin in the repo, to stay in synch
   # with any changes from others.
 
   # now pull down any changes in our own origin in the repo, to stay in synch
   # with any changes from others.
@@ -439,7 +439,7 @@ function do_careful_git_update()
 #it does an --all, but is that effective or different?  should we be doing that in above loop?
 # --no-ff   
   promote_pipe_return 0
 #it does an --all, but is that effective or different?  should we be doing that in above loop?
 # --no-ff   
   promote_pipe_return 0
-  test_or_die "git pulling all upstream"
+  exit_on_error "git pulling all upstream"
 
   popd &>/dev/null
 }
 
   popd &>/dev/null
 }
@@ -464,14 +464,14 @@ function do_update()
       $blatt
       cvs update . | $TO_SPLITTER
       promote_pipe_return 0
       $blatt
       cvs update . | $TO_SPLITTER
       promote_pipe_return 0
-      test_or_die "cvs update"
+      exit_on_error "cvs update"
     fi
   elif [ -d ".svn" ]; then
     if test_writeable ".svn"; then
       $blatt
       svn update . | $TO_SPLITTER
       promote_pipe_return 0
     fi
   elif [ -d ".svn" ]; then
     if test_writeable ".svn"; then
       $blatt
       svn update . | $TO_SPLITTER
       promote_pipe_return 0
-      test_or_die "svn update"
+      exit_on_error "svn update"
     fi
   elif [ -d ".git" ]; then
     if test_writeable ".git"; then
     fi
   elif [ -d ".git" ]; then
     if test_writeable ".git"; then
@@ -479,7 +479,7 @@ function do_update()
       git pull --tags $PULL_ADDITION 2>&1 | grep -v "X11 forwarding request failed" | $TO_SPLITTER
 #ordinary pulls should be allowed to do fast forward: --no-ff 
       promote_pipe_return 0
       git pull --tags $PULL_ADDITION 2>&1 | grep -v "X11 forwarding request failed" | $TO_SPLITTER
 #ordinary pulls should be allowed to do fast forward: --no-ff 
       promote_pipe_return 0
-      test_or_die "git pull of origin"
+      exit_on_error "git pull of origin"
     fi
   else
     # this is not an error necessarily; we'll just pretend they planned this.
     fi
   else
     # this is not an error necessarily; we'll just pretend they planned this.
@@ -510,7 +510,7 @@ function checkout_list()
       # yep, this path is absolute.  just handle it directly.
       if [ ! -d "$outer" ]; then continue; fi
       do_update $outer
       # yep, this path is absolute.  just handle it directly.
       if [ ! -d "$outer" ]; then continue; fi
       do_update $outer
-      test_or_die "running update on: $path"
+      exit_on_error "running update on: $path"
       sep 28
     else
       for inner in $list; do
       sep 28
     else
       for inner in $list; do
@@ -518,7 +518,7 @@ function checkout_list()
         local path="$inner/$outer"
         if [ ! -d "$path" ]; then continue; fi
         do_update $path
         local path="$inner/$outer"
         if [ ! -d "$path" ]; then continue; fi
         do_update $path
-        test_or_die "running update on: $path"
+        exit_on_error "running update on: $path"
         sep 28
       done
     fi
         sep 28
       done
     fi
@@ -574,7 +574,7 @@ function perform_revctrl_action_on_file()
     echo "[$(pwd)]"
     # pass the current directory plus the remaining parameters from function invocation.
     $action . 
     echo "[$(pwd)]"
     # pass the current directory plus the remaining parameters from function invocation.
     $action . 
-    test_or_die "performing action $action on: $(pwd)"
+    exit_on_error "performing action $action on: $(pwd)"
     sep 28
     popd &>/dev/null
   done 3<"$tempfile"
     sep 28
     popd &>/dev/null
   done 3<"$tempfile"
index 3d0dc8ea4ba37e779d4533003a7e46008b791b30..e17f87a92b45af7ade605f19fe386b7f5f118e1a 100644 (file)
@@ -24,7 +24,7 @@ function reapply_cool_permissions()
   # everything else is only re-permed if it exists.
   if [ ! -d "$DEFAULT_FEISTYMEOW_ORG_DIR" ]; then
     sudo mkdir "$DEFAULT_FEISTYMEOW_ORG_DIR"
   # everything else is only re-permed if it exists.
   if [ ! -d "$DEFAULT_FEISTYMEOW_ORG_DIR" ]; then
     sudo mkdir "$DEFAULT_FEISTYMEOW_ORG_DIR"
-    test_or_die "making directory: $DEFAULT_FEISTYMEOW_ORG_DIR"
+    exit_on_error "making directory: $DEFAULT_FEISTYMEOW_ORG_DIR"
   fi
 
   # fix some permissions for important security considerations.
   fi
 
   # fix some permissions for important security considerations.
@@ -43,33 +43,33 @@ function reapply_cool_permissions()
     if [ -d "$dirname" ]; then
       echo "revising ownership on '$dirname'"
       sudo chown -R ${cooluser}:${cooluser} "$dirname"
     if [ -d "$dirname" ]; then
       echo "revising ownership on '$dirname'"
       sudo chown -R ${cooluser}:${cooluser} "$dirname"
-      test_or_die "chowning for ${cooluser}: $dirname"
+      exit_on_error "chowning for ${cooluser}: $dirname"
     fi
   done
 
   # special case for archives directory in stuffing.
   if [ -d /z/stuffing -o -L /z/stuffing ]; then
     sudo chown ${cooluser}:${cooluser} /z/
     fi
   done
 
   # special case for archives directory in stuffing.
   if [ -d /z/stuffing -o -L /z/stuffing ]; then
     sudo chown ${cooluser}:${cooluser} /z/
-    test_or_die "chowning /z for ${cooluser}"
+    exit_on_error "chowning /z for ${cooluser}"
     sudo chmod g+rx,o+rx /z
     sudo chmod g+rx,o+rx /z
-    test_or_die "chmodding /z/ for ${cooluser}"
+    exit_on_error "chmodding /z/ for ${cooluser}"
     sudo chown ${cooluser}:${cooluser} /z/stuffing/
     sudo chown ${cooluser}:${cooluser} /z/stuffing/
-    test_or_die "chowning /z/stuffing for ${cooluser}"
+    exit_on_error "chowning /z/stuffing for ${cooluser}"
     sudo chmod g+rx,o-rwx /z/stuffing
     sudo chmod g+rx,o-rwx /z/stuffing
-    test_or_die "chmodding /z/stuffing for ${cooluser}"
+    exit_on_error "chmodding /z/stuffing for ${cooluser}"
     pushd /z/stuffing &>/dev/null
     if [ -d archives -o -L archives ]; then
       sudo chown ${cooluser}:${cooluser} archives/
     pushd /z/stuffing &>/dev/null
     if [ -d archives -o -L archives ]; then
       sudo chown ${cooluser}:${cooluser} archives/
-      test_or_die "chowning /z/stuffing/archives for ${cooluser}"
+      exit_on_error "chowning /z/stuffing/archives for ${cooluser}"
       sudo chmod -R g+rwx archives
       sudo chmod -R g+rwx archives
-      test_or_die "chmodding /z/stuffing/archives for ${cooluser}"
+      exit_on_error "chmodding /z/stuffing/archives for ${cooluser}"
     fi
     popd &>/dev/null
   fi
 
   # make the log files readable by normal humans.
   sudo bash $FEISTY_MEOW_SCRIPTS/security/normal_perm.sh /var/log
     fi
     popd &>/dev/null
   fi
 
   # make the log files readable by normal humans.
   sudo bash $FEISTY_MEOW_SCRIPTS/security/normal_perm.sh /var/log
-  test_or_die "setting normal perms on /var/log"
+  exit_on_error "setting normal perms on /var/log"
 }
 
 # this block should execute when the script is actually run, rather
 }
 
 # this block should execute when the script is actually run, rather
@@ -83,10 +83,10 @@ echo B
   export FEISTY_MEOW_APEX="$( \cd "$THISDIR/../.." && \pwd )"
 echo B.2
   source "$THISDIR/../core/launch_feisty_meow.sh"
   export FEISTY_MEOW_APEX="$( \cd "$THISDIR/../.." && \pwd )"
 echo B.2
   source "$THISDIR/../core/launch_feisty_meow.sh"
-  test_or_die "sourcing the feisty meow launcher"
+  exit_on_error "sourcing the feisty meow launcher"
 echo C
   reapply_cool_permissions $(logname)
 echo C
   reapply_cool_permissions $(logname)
-  test_or_die "reapplying cool permissions on $(logname)"
+  exit_on_error "reapplying cool permissions on $(logname)"
 echo D
 fi
 
 echo D
 fi
 
index f1e0df135dceed04c85de9fd116385e7bb7f2a6f..490b94d8189c20b03340cecf5c4556761dab1249 100644 (file)
@@ -46,13 +46,13 @@ and (2) the password that should be stored.
   fi
 
   echo "$passwd" > "$passfile"
   fi
 
   echo "$passwd" > "$passfile"
-  test_or_die "writing password into the file $passfile"
+  exit_on_error "writing password into the file $passfile"
 
   chown root:root "$passfile"
 
   chown root:root "$passfile"
-  test_or_die "chowning the password file to root ownership for: $passfile"
+  exit_on_error "chowning the password file to root ownership for: $passfile"
 
   chmod 600 "$passfile"
 
   chmod 600 "$passfile"
-  test_or_die "restricting permissions on password file for: $passfile"
+  exit_on_error "restricting permissions on password file for: $passfile"
 }
 
 # reads a password from the console, without echoing the letters when they
 }
 
 # reads a password from the console, without echoing the letters when they
index 106c1fd3ef76be3234ac92d7a03637ddb180c240..5ccc61f78b68a1a273c53f6c0cd5852bfb74a56c 100644 (file)
@@ -27,7 +27,7 @@ if [ -z "$app_dirname" ]; then
 else
   test_app_folder "$BASE_APPLICATION_PATH" "$app_dirname"
 fi
 else
   test_app_folder "$BASE_APPLICATION_PATH" "$app_dirname"
 fi
-test_or_die "finding and testing app folder"
+exit_on_error "finding and testing app folder"
 
 # where we expect to find our checkout folder underneath.
 full_app_dir="$BASE_APPLICATION_PATH/$app_dirname"
 
 # where we expect to find our checkout folder underneath.
 full_app_dir="$BASE_APPLICATION_PATH/$app_dirname"
@@ -35,7 +35,7 @@ full_app_dir="$BASE_APPLICATION_PATH/$app_dirname"
 # simplistic approach here; just go to the folder and pull the changes.
 
 pushd "$full_app_dir" &>/dev/null
 # simplistic approach here; just go to the folder and pull the changes.
 
 pushd "$full_app_dir" &>/dev/null
-test_or_die "Changing to app path '$full_app_dir'"
+exit_on_error "Changing to app path '$full_app_dir'"
 
 dir="avenger5/vendor/siteavenger/avcore"
 if [ ! -d $dir ]; then
 
 dir="avenger5/vendor/siteavenger/avcore"
 if [ ! -d $dir ]; then
@@ -44,7 +44,7 @@ else
   pushd "$dir" &>/dev/null
 
   git pull
   pushd "$dir" &>/dev/null
 
   git pull
-  test_or_die "Pulling git repo for avcore under '$full_app_dir'"
+  exit_on_error "Pulling git repo for avcore under '$full_app_dir'"
 
   echo "Finished updating the avcore portion of site in ${app_dirname}."
 
 
   echo "Finished updating the avcore portion of site in ${app_dirname}."
 
index 5054cdd7db9b1e458b91a5f86cb06301f193b2be..e2c8755e9c2d020c4df6f8910c0a58a2fc2fe84e 100644 (file)
@@ -9,29 +9,29 @@ echo Doing some git repository maintenance in fred account.
 #
 # change over to fred folder
 pushd /home/fred
 #
 # change over to fred folder
 pushd /home/fred
-test_or_die "changing dir to fred's home; what have you done with fred?"
+exit_on_error "changing dir to fred's home; what have you done with fred?"
 
 pushd apps/mapsdemo/avenger5
 
 pushd apps/mapsdemo/avenger5
-test_or_die "changing dir to mapsdemo app"
+exit_on_error "changing dir to mapsdemo app"
 
 rpuffer . &>/dev/null
 if [ $? -ne 0 ]; then
   # it seems our old files are still conflicting this.
   if [ -f config/config_google.php ]; then
     \rm -f config/config_google.php
 
 rpuffer . &>/dev/null
 if [ $? -ne 0 ]; then
   # it seems our old files are still conflicting this.
   if [ -f config/config_google.php ]; then
     \rm -f config/config_google.php
-    test_or_die "removing old config for google"
+    exit_on_error "removing old config for google"
   fi
   if [ -f config/app.php ]; then
     \rm -f config/app.php
   fi
   if [ -f config/app.php ]; then
     \rm -f config/app.php
-    test_or_die "removing old config for app"
+    exit_on_error "removing old config for app"
   fi
 
   git reset --hard HEAD
   fi
 
   git reset --hard HEAD
-  test_or_die "resetting git's hard head"
+  exit_on_error "resetting git's hard head"
 
   rpuffer .
 #hmmm: use output saver thing when that exists.
 
   rpuffer .
 #hmmm: use output saver thing when that exists.
-  test_or_die "puffing out mapsdemo app after inadequate corrective action was taken"
+  exit_on_error "puffing out mapsdemo app after inadequate corrective action was taken"
 fi
 
 popd
 fi
 
 popd
index 28e03240535621e09910b5bba5223a51ba31cf78..ef4c0976c999ed7c1e029798ea7f8738719538f4 100644 (file)
@@ -68,7 +68,7 @@ if [ -z "$app_dirname" ]; then
 else
   test_app_folder "$BASE_APPLICATION_PATH" "$app_dirname"
 fi
 else
   test_app_folder "$BASE_APPLICATION_PATH" "$app_dirname"
 fi
-test_or_die "finding and testing app folder"
+exit_on_error "finding and testing app folder"
 
 # where we expect to find our checkout folder underneath.
 full_app_dir="$BASE_APPLICATION_PATH/$app_dirname"
 
 # where we expect to find our checkout folder underneath.
 full_app_dir="$BASE_APPLICATION_PATH/$app_dirname"
@@ -96,12 +96,12 @@ var CHECKOUT_DIR_NAME DEFAULT_REPOSITORY_ROOT
 
 # this should set the site_store_path variable if everything goes well.
 update_repo "$full_app_dir" "$CHECKOUT_DIR_NAME" "$DEFAULT_REPOSITORY_ROOT" "$repo_name"
 
 # this should set the site_store_path variable if everything goes well.
 update_repo "$full_app_dir" "$CHECKOUT_DIR_NAME" "$DEFAULT_REPOSITORY_ROOT" "$repo_name"
-test_or_die "Updating the repository storage directory"
+exit_on_error "Updating the repository storage directory"
 
 # update the site to load dependencies.
 sep
 composer_repuff "$site_store_path"
 
 # update the site to load dependencies.
 sep
 composer_repuff "$site_store_path"
-test_or_die "Installing site dependencies with composer"
+exit_on_error "Installing site dependencies with composer"
 
 # set up the symbolic links needed to achieve siteliness.
 sep
 
 # set up the symbolic links needed to achieve siteliness.
 sep
index 7c479d043b393b33109d8bfffc4ccf545d065914..205fcb4c91afbf23ed985d9fd146c812b7107dbe 100644 (file)
@@ -46,9 +46,9 @@ sep
 echo "Regenerating feisty meow loading dock."
 
 regenerate
 echo "Regenerating feisty meow loading dock."
 
 regenerate
-test_or_die "regenerating feisty meow configuration"
+exit_on_error "regenerating feisty meow configuration"
 chown -R "$(logname)":"$(logname)" /home/$(logname)/.[a-zA-Z0-9]*
 chown -R "$(logname)":"$(logname)" /home/$(logname)/.[a-zA-Z0-9]*
-test_or_die "fix after reconfigured as sudo"
+exit_on_error "fix after reconfigured as sudo"
 
 ##############
 
 
 ##############
 
@@ -69,7 +69,7 @@ mysql -u root -p"$mysql_passwd" &>/dev/null <<EOF
   create user if not exists 'lampcake'@'%' IDENTIFIED BY 'bakecamp';
   grant all privileges on *.* TO 'lampcake'@'%' with grant option;
 EOF
   create user if not exists 'lampcake'@'%' IDENTIFIED BY 'bakecamp';
   grant all privileges on *.* TO 'lampcake'@'%' with grant option;
 EOF
-test_or_die "configuring root, wampcake and lampcake users on mysql"
+exit_on_error "configuring root, wampcake and lampcake users on mysql"
 
 ##############
 
 
 ##############
 
@@ -81,17 +81,17 @@ echo "Making some important permission changes..."
 
 # fix up the main web storage.
 chown -R www-data:www-data /var/www 
 
 # fix up the main web storage.
 chown -R www-data:www-data /var/www 
-test_or_die "chown www-data"
+exit_on_error "chown www-data"
 group_perm /var/www 
 group_perm /var/www 
-test_or_die "group_perm www-data"
+exit_on_error "group_perm www-data"
 
 ##############
 
 # set up access on some important folders for the developer user.
 chown -R developer:developer /home/developer /home/developer/.[a-zA-Z0-9]*
 
 ##############
 
 # set up access on some important folders for the developer user.
 chown -R developer:developer /home/developer /home/developer/.[a-zA-Z0-9]*
-test_or_die "chown developer home"
+exit_on_error "chown developer home"
 harsh_perm /home/developer/.ssh
 harsh_perm /home/developer/.ssh
-test_or_die "harsh_perm setting on developer .ssh"
+exit_on_error "harsh_perm setting on developer .ssh"
 
 
 ##############
 
 
 ##############
@@ -99,25 +99,25 @@ test_or_die "harsh_perm setting on developer .ssh"
 # give the developer control over the apache and bind config files, as well
 # as giving the user ownership of the local feisty meow repository.
 chown -R developer:developer /etc/apache2 /etc/bind 
 # give the developer control over the apache and bind config files, as well
 # as giving the user ownership of the local feisty meow repository.
 chown -R developer:developer /etc/apache2 /etc/bind 
-test_or_die "chown apache2 and bind to developer"
+exit_on_error "chown apache2 and bind to developer"
 group_perm /etc/apache2 /etc/bind 
 group_perm /etc/apache2 /etc/bind 
-test_or_die "group perms on apache2 and bind"
+exit_on_error "group perms on apache2 and bind"
 chown -R developer:developer /opt/feistymeow.org 
 chown -R developer:developer /opt/feistymeow.org 
-test_or_die "chown feisty meow to developer"
+exit_on_error "chown feisty meow to developer"
 group_perm /opt/feistymeow.org 
 group_perm /opt/feistymeow.org 
-test_or_die "group perms on feisty meow"
+exit_on_error "group perms on feisty meow"
 
 ##############
 
 # fix perms for fred user.
 chown -R fred:fred /home/fred /home/archives/stuffing /home/fred/.[a-zA-Z0-9]*
 
 ##############
 
 # fix perms for fred user.
 chown -R fred:fred /home/fred /home/archives/stuffing /home/fred/.[a-zA-Z0-9]*
-test_or_die "chown fred home"
+exit_on_error "chown fred home"
 group_perm $HOME/apps
 group_perm $HOME/apps
-test_or_die "group perms on fred's apps"
+exit_on_error "group perms on fred's apps"
 harsh_perm /home/fred/.ssh
 harsh_perm /home/fred/.ssh
-test_or_die "harsh_perm setting on fred .ssh"
+exit_on_error "harsh_perm setting on fred .ssh"
 group_perm /home/fred/apps/mapsdemo
 group_perm /home/fred/apps/mapsdemo
-test_or_die "group perms on mapsdemo app"
+exit_on_error "group perms on mapsdemo app"
 
 echo "...done with permission changes."
 
 
 echo "...done with permission changes."
 
@@ -137,7 +137,7 @@ echo "Updating developer welcome file."
 if [ -f "$HOME/hello.txt" ]; then
   # copy the most recent hello file into place for the user.
   \cp -f "$FEISTY_MEOW_APEX/production/sites/cakelampvm.com/hello.txt" "$HOME"
 if [ -f "$HOME/hello.txt" ]; then
   # copy the most recent hello file into place for the user.
   \cp -f "$FEISTY_MEOW_APEX/production/sites/cakelampvm.com/hello.txt" "$HOME"
-  test_or_continue "copying hello file for user"
+  continue_on_error "copying hello file for user"
 fi
 
 ##############
 fi
 
 ##############
@@ -159,26 +159,26 @@ if [ -L /etc/apache2/sites-enabled/000-default.conf ]; then
   echo "Updating default web sites to latest version."
 
   a2enmod ssl
   echo "Updating default web sites to latest version."
 
   a2enmod ssl
-  test_or_die "enabling SSL for secure websites"
+  exit_on_error "enabling SSL for secure websites"
 
   restart_apache
 
   restart_apache
-  test_or_die "getting SSL loaded in apache"
+  exit_on_error "getting SSL loaded in apache"
 
   a2dissite 000-default
 
   a2dissite 000-default
-  test_or_die "disabling old apache site"
+  exit_on_error "disabling old apache site"
 
   rm -f /etc/apache2/sites-available/000-default.conf 
 
   rm -f /etc/apache2/sites-available/000-default.conf 
-  test_or_die "removing old apache site"
+  exit_on_error "removing old apache site"
 
   # copy in our new version of the default page.
 #hmmm: would be nice if this worked without mods for any new version, besides just 001.  see apache env var file below for example implem.
   \cp -f $FEISTY_MEOW_APEX/production/sites/cakelampvm.com/rolling/default_page.001/* \
       /etc/apache2/sites-available
 
   # copy in our new version of the default page.
 #hmmm: would be nice if this worked without mods for any new version, besides just 001.  see apache env var file below for example implem.
   \cp -f $FEISTY_MEOW_APEX/production/sites/cakelampvm.com/rolling/default_page.001/* \
       /etc/apache2/sites-available
-  test_or_die "installing new apache default sites"
+  exit_on_error "installing new apache default sites"
 
   # there should only be ours at this version level and with that prefix.
   a2ensite 001-*
 
   # there should only be ours at this version level and with that prefix.
   a2ensite 001-*
-  test_or_die "enabling new apache default sites"
+  exit_on_error "enabling new apache default sites"
 
   restart_apache
 fi
 
   restart_apache
 fi
@@ -247,7 +247,7 @@ replacement="read only = no"
 # after realizing the sentinel pattern was actually already in the file...
 # too much subtlety can get one into trouble.
 sed -i "0,/$pattern/{s/$pattern/$replacement/}" /etc/samba/smb.conf
 # after realizing the sentinel pattern was actually already in the file...
 # too much subtlety can get one into trouble.
 sed -i "0,/$pattern/{s/$pattern/$replacement/}" /etc/samba/smb.conf
-test_or_die "patching samba configuration to enable write acccess on user home dirs"
+exit_on_error "patching samba configuration to enable write acccess on user home dirs"
 echo successfully patched the samba configuration to enable writes on user home directories. 
 
 # add in a disabling of the archive bit mapping feature, which hoses up the execute bit
 echo successfully patched the samba configuration to enable writes on user home directories. 
 
 # add in a disabling of the archive bit mapping feature, which hoses up the execute bit
@@ -256,7 +256,7 @@ grep -q "map archive" /etc/samba/smb.conf
 # if the phrase wasn't found, we need to add it.
 if [ $? -ne 0 ]; then
   sed -i "s/\[global\]/\[global\]\n\nmap archive = no/" /etc/samba/smb.conf
 # if the phrase wasn't found, we need to add it.
 if [ $? -ne 0 ]; then
   sed -i "s/\[global\]/\[global\]\n\nmap archive = no/" /etc/samba/smb.conf
-  test_or_die "patching samba configuration to turn off archive bit mapping feature"
+  exit_on_error "patching samba configuration to turn off archive bit mapping feature"
   echo Successfully fixed Samba to not use the archive bit mapping feature.
 fi
 
   echo Successfully fixed Samba to not use the archive bit mapping feature.
 fi
 
@@ -275,11 +275,11 @@ a2disconf env_vars_cakelampvm &>/dev/null
 # plug in the new version, just stomping anything there.
 # note: we only expect to have one version of the env_vars dir at a time in place in feisty...
 \cp -f $FEISTY_MEOW_APEX/production/sites/cakelampvm.com/rolling/env_vars.*/env_vars_cakelampvm.conf /etc/apache2/conf-available
 # plug in the new version, just stomping anything there.
 # note: we only expect to have one version of the env_vars dir at a time in place in feisty...
 \cp -f $FEISTY_MEOW_APEX/production/sites/cakelampvm.com/rolling/env_vars.*/env_vars_cakelampvm.conf /etc/apache2/conf-available
-test_or_die "copying environment variables file into place"
+exit_on_error "copying environment variables file into place"
 
 # enable the new version of the config file.
 a2enconf env_vars_cakelampvm
 
 # enable the new version of the config file.
 a2enconf env_vars_cakelampvm
-test_or_die "enabling the new cakelampvm environment config for apache"
+exit_on_error "enabling the new cakelampvm environment config for apache"
 
 echo Successfully configured the apache2 environment variables needed for cakelampvm.
 
 
 echo Successfully configured the apache2 environment variables needed for cakelampvm.
 
@@ -377,9 +377,9 @@ fi
 sep
 
 regenerate
 sep
 
 regenerate
-test_or_die "regenerating feisty meow scripts"
+exit_on_error "regenerating feisty meow scripts"
 chown -R "$(logname)":"$(logname)" /home/$(logname)/.[a-zA-Z0-9]*
 chown -R "$(logname)":"$(logname)" /home/$(logname)/.[a-zA-Z0-9]*
-test_or_die "fix after regenerate as sudo"
+exit_on_error "fix after regenerate as sudo"
 echo "
 
 
 echo "
 
 
index 66e4c89b2d347b5827df5f675fd6f003f6c452c4..5cd4a5783fb6773fe80587f6e5d03349f7b690e7 100644 (file)
@@ -46,9 +46,9 @@ sep
 echo "Regenerating feisty meow loading dock."
 
 regenerate
 echo "Regenerating feisty meow loading dock."
 
 regenerate
-test_or_die "regenerating feisty meow configuration"
+exit_on_error "regenerating feisty meow configuration"
 chown -R "$(logname)":"$(logname)" /home/$(logname)/.[a-zA-Z0-9]*
 chown -R "$(logname)":"$(logname)" /home/$(logname)/.[a-zA-Z0-9]*
-test_or_die "fix after reconfigured as sudo"
+exit_on_error "fix after reconfigured as sudo"
 
 ##############
 
 
 ##############
 
@@ -69,7 +69,7 @@ mysql -u root -p"$mysql_passwd" &>/dev/null <<EOF
   create user if not exists 'lampcake'@'%' IDENTIFIED BY 'bakecamp';
   grant all privileges on *.* TO 'lampcake'@'%' with grant option;
 EOF
   create user if not exists 'lampcake'@'%' IDENTIFIED BY 'bakecamp';
   grant all privileges on *.* TO 'lampcake'@'%' with grant option;
 EOF
-test_or_die "configuring root, wampcake and lampcake users on mysql"
+exit_on_error "configuring root, wampcake and lampcake users on mysql"
 
 ##############
 
 
 ##############
 
@@ -81,9 +81,9 @@ echo "Making some important permission changes..."
 
 # fix up the main web storage.
 chown -R www-data:www-data /var/www 
 
 # fix up the main web storage.
 chown -R www-data:www-data /var/www 
-test_or_die "chown www-data"
+exit_on_error "chown www-data"
 group_perm /var/www 
 group_perm /var/www 
-test_or_die "group_perm www-data"
+exit_on_error "group_perm www-data"
 
 ##############
 
 
 ##############
 
@@ -92,20 +92,20 @@ test_or_die "group_perm www-data"
 # set the developer user as uber owner of many things with redeveloper alias.
 # (must have run feisty meow "recustomize" command at some point to enable.)
 redeveloper
 # set the developer user as uber owner of many things with redeveloper alias.
 # (must have run feisty meow "recustomize" command at some point to enable.)
 redeveloper
-test_or_die "running redeveloper to fix ownership"
+exit_on_error "running redeveloper to fix ownership"
 
 ##############
 
 # give the developer control over the apache and bind config files, as well
 # as giving the user ownership of the local feisty meow repository.
 chown -R developer:developer /etc/apache2 /etc/bind 
 
 ##############
 
 # give the developer control over the apache and bind config files, as well
 # as giving the user ownership of the local feisty meow repository.
 chown -R developer:developer /etc/apache2 /etc/bind 
-test_or_die "chown apache2 and bind to developer"
+exit_on_error "chown apache2 and bind to developer"
 group_perm /etc/apache2 /etc/bind 
 group_perm /etc/apache2 /etc/bind 
-test_or_die "group perms on apache2 and bind"
+exit_on_error "group perms on apache2 and bind"
 chown -R developer:developer /opt/feistymeow.org 
 chown -R developer:developer /opt/feistymeow.org 
-test_or_die "chown feisty meow to developer"
+exit_on_error "chown feisty meow to developer"
 group_perm /opt/feistymeow.org 
 group_perm /opt/feistymeow.org 
-test_or_die "group perms on feisty meow"
+exit_on_error "group perms on feisty meow"
 
 ##############
 
 
 ##############
 
@@ -133,9 +133,9 @@ echo "...done with permission changes."
 sep
 
 regenerate
 sep
 
 regenerate
-test_or_die "regenerating feisty meow scripts"
+exit_on_error "regenerating feisty meow scripts"
 chown -R "$(logname)":"$(logname)" /home/$(logname)/.[a-zA-Z0-9]*
 chown -R "$(logname)":"$(logname)" /home/$(logname)/.[a-zA-Z0-9]*
-test_or_die "fix after regenerate as sudo"
+exit_on_error "fix after regenerate as sudo"
 echo "
 
 
 echo "
 
 
index 4f35016d0c7b59a165f4fdd2063923b10974c2b5..015d3e68f9485ca4d2015cd6c180e1d259f1718c 100644 (file)
@@ -24,7 +24,7 @@ fi
 
 # load in at least the default version to get us moving.
 source "$SITE_MANAGEMENT_CONFIG_FILE"
 
 # load in at least the default version to get us moving.
 source "$SITE_MANAGEMENT_CONFIG_FILE"
-test_or_die "loading site management configuration from: $SITE_MANAGEMENT_CONFIG_FILE"
+exit_on_error "loading site management configuration from: $SITE_MANAGEMENT_CONFIG_FILE"
 
 # configure feisty revision control to ignore vendor folders.
 export NO_CHECKIN_VENDOR=true
 
 # configure feisty revision control to ignore vendor folders.
 export NO_CHECKIN_VENDOR=true
@@ -36,7 +36,7 @@ function check_apps_root()
   if [ ! -d "$appdir" ]; then
     echo "$(date_stringer): Creating the apps directory: $appdir" >> "$SSM_LOG_FILE"
     mkdir "$appdir"
   if [ ! -d "$appdir" ]; then
     echo "$(date_stringer): Creating the apps directory: $appdir" >> "$SSM_LOG_FILE"
     mkdir "$appdir"
-    test_or_die "Making apps directory when not already present"
+    exit_on_error "Making apps directory when not already present"
   fi
 }
 
   fi
 }
 
@@ -63,7 +63,7 @@ the standard pattern for cakephp projects." >> "$SSM_LOG_FILE"
 
   # try to load the config.
   source "$SITE_MANAGEMENT_CONFIG_FILE"
 
   # try to load the config.
   source "$SITE_MANAGEMENT_CONFIG_FILE"
-  test_or_die "loading site management configuration from: $SITE_MANAGEMENT_CONFIG_FILE"
+  exit_on_error "loading site management configuration from: $SITE_MANAGEMENT_CONFIG_FILE"
 
   return 0
 }
 
   return 0
 }
@@ -94,7 +94,7 @@ function find_app_folder()
     exit 1
   elif [ $numdirs -eq 1 ]; then
     app_dirname="$(basename $(find "$appsdir" -mindepth 1 -maxdepth 1 -type d) )"
     exit 1
   elif [ $numdirs -eq 1 ]; then
     app_dirname="$(basename $(find "$appsdir" -mindepth 1 -maxdepth 1 -type d) )"
-    test_or_die "Guessing application folder"
+    exit_on_error "Guessing application folder"
   else
     # if more than one folder, force user to choose.
     # Reference: https://askubuntu.com/questions/1705/how-can-i-create-a-select-menu-in-a-shell-script
   else
     # if more than one folder, force user to choose.
     # Reference: https://askubuntu.com/questions/1705/how-can-i-create-a-select-menu-in-a-shell-script
@@ -115,7 +115,7 @@ function find_app_folder()
     PS3="$holdps3"
   fi
   test_app_folder "$appsdir" "$app_dirname"
     PS3="$holdps3"
   fi
   test_app_folder "$appsdir" "$app_dirname"
-  test_or_die "Testing application folder: $app_dirname"
+  exit_on_error "Testing application folder: $app_dirname"
 
   echo "Application folder is: $app_dirname"
   return 0
 
   echo "Application folder is: $app_dirname"
   return 0
@@ -133,7 +133,7 @@ function test_app_folder()
   if [ ! -d "$combo" ]; then
     echo "$(date_stringer): Creating app directory: $combo" >> "$SSM_LOG_FILE"
     mkdir "$combo"
   if [ ! -d "$combo" ]; then
     echo "$(date_stringer): Creating app directory: $combo" >> "$SSM_LOG_FILE"
     mkdir "$combo"
-    test_or_die "Making application directory when not already present"
+    exit_on_error "Making application directory when not already present"
   fi
 
   locate_config_file "$dir"
   fi
 
   locate_config_file "$dir"
@@ -148,17 +148,17 @@ function fix_site_perms()
 
   if [ -f "$site_dir/bin/cake" ]; then
     sudo chmod -R a+rx "$site_dir/bin/cake"
 
   if [ -f "$site_dir/bin/cake" ]; then
     sudo chmod -R a+rx "$site_dir/bin/cake"
-    test_or_die "Enabling execute bit on cake binary"
+    exit_on_error "Enabling execute bit on cake binary"
   fi
 
   if [ -d "$site_dir/logs" ]; then
     sudo chmod -R g+w "$site_dir/logs"
   fi
 
   if [ -d "$site_dir/logs" ]; then
     sudo chmod -R g+w "$site_dir/logs"
-    test_or_die "Enabling group write on site's Logs directory"
+    exit_on_error "Enabling group write on site's Logs directory"
   fi
 
   if [ -d "$site_dir/tmp" ]; then
     sudo chmod -R g+w "$site_dir/tmp"
   fi
 
   if [ -d "$site_dir/tmp" ]; then
     sudo chmod -R g+w "$site_dir/tmp"
-    test_or_die "Enabling group write on site's tmp directory"
+    exit_on_error "Enabling group write on site's tmp directory"
   fi
 }
 
   fi
 }
 
@@ -170,7 +170,7 @@ function clear_orm_cache()
   if [ -f "$site_dir/bin/cake" ]; then
     # flush any cached objects from db.
     "$site_dir/bin/cake" orm_cache clear
   if [ -f "$site_dir/bin/cake" ]; then
     # flush any cached objects from db.
     "$site_dir/bin/cake" orm_cache clear
-    test_or_die "Clearing ORM cache"
+    exit_on_error "Clearing ORM cache"
   fi
 }
 
   fi
 }
 
@@ -193,7 +193,7 @@ echo "$(date_stringer): $(var full_app_dir checkout_dirname repo_root repo_name)
   unset site_store_path
 
   pushd "$full_app_dir" &>/dev/null
   unset site_store_path
 
   pushd "$full_app_dir" &>/dev/null
-  test_or_die "Switching to our app dir '$full_app_dir'"
+  exit_on_error "Switching to our app dir '$full_app_dir'"
 
   local complete_path="$full_app_dir/$checkout_dirname"
 
 
   local complete_path="$full_app_dir/$checkout_dirname"
 
@@ -203,7 +203,7 @@ echo "$(date_stringer): $(var full_app_dir checkout_dirname repo_root repo_name)
   if [ -d "$checkout_dirname" ]; then
     # checkout directory exists, so let's check it.
     pushd "$checkout_dirname" &>/dev/null
   if [ -d "$checkout_dirname" ]; then
     # checkout directory exists, so let's check it.
     pushd "$checkout_dirname" &>/dev/null
-    test_or_die "Switching to our checkout directory: $checkout_dirname"
+    exit_on_error "Switching to our checkout directory: $checkout_dirname"
 
     # ask for repository name (without .git).
     if git rev-parse --git-dir > /dev/null 2>&1; then
 
     # ask for repository name (without .git).
     if git rev-parse --git-dir > /dev/null 2>&1; then
@@ -225,12 +225,12 @@ echo "$(date_stringer): $(var full_app_dir checkout_dirname repo_root repo_name)
     # a repository was found, so update the version here and leave.
     echo "Repository $repo_name exists.  Updating it."
     rgetem
     # a repository was found, so update the version here and leave.
     echo "Repository $repo_name exists.  Updating it."
     rgetem
-    test_or_die "Recursive checkout on: $complete_path"
+    exit_on_error "Recursive checkout on: $complete_path"
   else
     # clone the repo since it wasn't found.
     echo "Cloning repository $repo_name now."
     git clone "$repo_root/$repo_name.git" $checkout_dirname
   else
     # clone the repo since it wasn't found.
     echo "Cloning repository $repo_name now."
     git clone "$repo_root/$repo_name.git" $checkout_dirname
-    test_or_die "Git clone of repository: $repo_name"
+    exit_on_error "Git clone of repository: $repo_name"
   fi
 
 #not doing this here since powerup uses this and has no sudo.
   fi
 
 #not doing this here since powerup uses this and has no sudo.
@@ -251,12 +251,12 @@ function composer_repuff()
   local site_store_path="$1"; shift
 
   pushd "$site_store_path" &>/dev/null
   local site_store_path="$1"; shift
 
   pushd "$site_store_path" &>/dev/null
-  test_or_die "Switching to our app dir '$site_store_path'"
+  exit_on_error "Switching to our app dir '$site_store_path'"
 
   echo "Updating site with composer..."
 
   composer -n install
 
   echo "Updating site with composer..."
 
   composer -n install
-  test_or_die "Composer installation step on '$site_store_path'."
+  exit_on_error "Composer installation step on '$site_store_path'."
   echo "Site updated."
 
 #hmmm: argh global
   echo "Site updated."
 
 #hmmm: argh global
@@ -290,13 +290,13 @@ function create_site_links()
 
   # jump into the site path so we can start making relative links.
   pushd "$site_store_path" &>/dev/null
 
   # jump into the site path so we can start making relative links.
   pushd "$site_store_path" &>/dev/null
-  test_or_die "Switching to our app dir '$site_store_path'"
+  exit_on_error "Switching to our app dir '$site_store_path'"
 
   pushd webroot &>/dev/null
 
   # remove all symlinks that might plague us.
   find . -maxdepth 1 -type l -exec rm -f {} ';'
 
   pushd webroot &>/dev/null
 
   # remove all symlinks that might plague us.
   find . -maxdepth 1 -type l -exec rm -f {} ';'
-  test_or_die "Cleaning out links in webroot"
+  exit_on_error "Cleaning out links in webroot"
 
   # link in the avcore plugin.
   make_safe_link "../vendor/siteavenger/avcore/webroot" avcore
 
   # link in the avcore plugin.
   make_safe_link "../vendor/siteavenger/avcore/webroot" avcore
@@ -323,18 +323,18 @@ function create_site_links()
   if [ -L public ]; then
     # public is a symlink.
     \rm public
   if [ -L public ]; then
     # public is a symlink.
     \rm public
-    test_or_die "Removing public directory symlink"
+    exit_on_error "Removing public directory symlink"
   elif [ -d public ]; then
     # public is a folder with default files.
 #hmmm: is that safe?
     \rm -rf public
   elif [ -d public ]; then
     # public is a folder with default files.
 #hmmm: is that safe?
     \rm -rf public
-    test_or_die "Removing public directory and contents"
+    exit_on_error "Removing public directory and contents"
   fi
 
   # create the main 'public' symlink
 #hmmm: argh global
   make_safe_link $CHECKOUT_DIR_NAME/webroot public
   fi
 
   # create the main 'public' symlink
 #hmmm: argh global
   make_safe_link $CHECKOUT_DIR_NAME/webroot public
-  test_or_die "Creating link to webroot called 'public'"
+  exit_on_error "Creating link to webroot called 'public'"
 
 #hmmm: public/$themelower/im will be created automatically by system user with appropriate permissions
 
 
 #hmmm: public/$themelower/im will be created automatically by system user with appropriate permissions
 
@@ -376,7 +376,7 @@ function fix_appdir_ownership()
     echo "$(date_stringer): Chowning the app folder to be owned by: $user_name" >> "$SSM_LOG_FILE"
 #hmmm: have to hope for now for standard group named after user 
     sudo chown -R "$user_name:$user_name" "$combo"
     echo "$(date_stringer): Chowning the app folder to be owned by: $user_name" >> "$SSM_LOG_FILE"
 #hmmm: have to hope for now for standard group named after user 
     sudo chown -R "$user_name:$user_name" "$combo"
-    test_or_die "Chowning $combo to be owned by $user_name"
+    exit_on_error "Chowning $combo to be owned by $user_name"
   else
     echo "$(date_stringer): user name failed checks for chowning, was found as '$user_name'" >> "$SSM_LOG_FILE"
   fi
   else
     echo "$(date_stringer): user name failed checks for chowning, was found as '$user_name'" >> "$SSM_LOG_FILE"
   fi
index 8a69d5daa2ddb37d9ff44f8537f35f6657467395..503ae1349cfc979b67704eba1892aac37a81418b 100644 (file)
@@ -28,7 +28,7 @@ if [ -z "$app_dirname" ]; then
 else
   test_app_folder "$BASE_APPLICATION_PATH" "$app_dirname"
 fi
 else
   test_app_folder "$BASE_APPLICATION_PATH" "$app_dirname"
 fi
-test_or_die "finding and testing app folder"
+exit_on_error "finding and testing app folder"
 
 # where we expect to find our checkout folder underneath.
 full_app_dir="$BASE_APPLICATION_PATH/$app_dirname"
 
 # where we expect to find our checkout folder underneath.
 full_app_dir="$BASE_APPLICATION_PATH/$app_dirname"
@@ -43,7 +43,7 @@ sep
 
 # this should set the site_store_path variable if everything goes well.
 update_repo "$full_app_dir" "$CHECKOUT_DIR_NAME" "$DEFAULT_REPOSITORY_ROOT" "$repo_name"
 
 # this should set the site_store_path variable if everything goes well.
 update_repo "$full_app_dir" "$CHECKOUT_DIR_NAME" "$DEFAULT_REPOSITORY_ROOT" "$repo_name"
-test_or_die "Updating the repository storage directory"
+exit_on_error "Updating the repository storage directory"
 
 sep
 
 
 sep
 
index 8c186ad904da0b05d1af6fdefeda797f2d1b845f..d3ff8125894475dec8eac6d5728136cc1187849f 100644 (file)
@@ -28,7 +28,7 @@ if [ -z "$app_dirname" ]; then
 else
   test_app_folder "$BASE_APPLICATION_PATH" "$app_dirname"
 fi
 else
   test_app_folder "$BASE_APPLICATION_PATH" "$app_dirname"
 fi
-test_or_die "finding and testing app folder"
+exit_on_error "finding and testing app folder"
 
 # where we expect to find our checkout folder underneath.
 full_app_dir="$BASE_APPLICATION_PATH/$app_dirname"
 
 # where we expect to find our checkout folder underneath.
 full_app_dir="$BASE_APPLICATION_PATH/$app_dirname"
@@ -43,7 +43,7 @@ sep
 
 # this should set the site_store_path variable if everything goes well.
 update_repo "$full_app_dir" "$CHECKOUT_DIR_NAME" "$DEFAULT_REPOSITORY_ROOT" "$repo_name"
 
 # this should set the site_store_path variable if everything goes well.
 update_repo "$full_app_dir" "$CHECKOUT_DIR_NAME" "$DEFAULT_REPOSITORY_ROOT" "$repo_name"
-test_or_die "Updating the repository storage directory"
+exit_on_error "Updating the repository storage directory"
 
 ####
 
 
 ####
 
index 72378ca8d4c48b78fdd7673639c6cdf0292d1c82..ca9ee7680d75dc252999ed5e79561fe987a83724 100644 (file)
@@ -64,24 +64,24 @@ if [ -z "$app_dirname" ]; then
 else
   test_app_folder "$BASE_APPLICATION_PATH" "$app_dirname"
 fi
 else
   test_app_folder "$BASE_APPLICATION_PATH" "$app_dirname"
 fi
-test_or_die "finding and testing app folder"
+exit_on_error "finding and testing app folder"
 
 #echo "!! domain being added is: $DOMAIN_NAME"
 
 sudo bash "$FEISTY_MEOW_SCRIPTS/system/add_domain.sh" "$DOMAIN_NAME"
 
 #echo "!! domain being added is: $DOMAIN_NAME"
 
 sudo bash "$FEISTY_MEOW_SCRIPTS/system/add_domain.sh" "$DOMAIN_NAME"
-test_or_die "Setting up domain: $DOMAIN_NAME"
+exit_on_error "Setting up domain: $DOMAIN_NAME"
 
 sep
 
 # add the main website as specified by the domain name they gave us.
 sudo bash "$FEISTY_MEOW_SCRIPTS/system/add_apache_site.sh" "$APPLICATION_NAME" "$DOMAIN_NAME"
 
 sep
 
 # add the main website as specified by the domain name they gave us.
 sudo bash "$FEISTY_MEOW_SCRIPTS/system/add_apache_site.sh" "$APPLICATION_NAME" "$DOMAIN_NAME"
-test_or_die "Setting up apache site for: $APPLICATION_NAME"
+exit_on_error "Setting up apache site for: $APPLICATION_NAME"
 
 # make the shadow site also, which always ends in cakelampvm.com.
 shadow_domain="${APPLICATION_NAME}.cakelampvm.com"
 if [ "$shadow_domain" != "$DOMAIN_NAME" ]; then
   sudo bash "$FEISTY_MEOW_SCRIPTS/system/add_apache_site.sh" "$APPLICATION_NAME" "$shadow_domain"
 
 # make the shadow site also, which always ends in cakelampvm.com.
 shadow_domain="${APPLICATION_NAME}.cakelampvm.com"
 if [ "$shadow_domain" != "$DOMAIN_NAME" ]; then
   sudo bash "$FEISTY_MEOW_SCRIPTS/system/add_apache_site.sh" "$APPLICATION_NAME" "$shadow_domain"
-  test_or_die "Setting up shadow apache site on '$shadow_domain'"
+  exit_on_error "Setting up shadow apache site on '$shadow_domain'"
 fi
 
 sep
 fi
 
 sep
index 68fa0e14e979bfd32b283d05539359df92d989ef..13d4b3a9397a6172cc4993522ea45cae95956cdf 100644 (file)
@@ -56,18 +56,18 @@ if [ -z "$app_dirname" ]; then
 else
   test_app_folder "$BASE_APPLICATION_PATH" "$app_dirname"
 fi
 else
   test_app_folder "$BASE_APPLICATION_PATH" "$app_dirname"
 fi
-test_or_die "finding and testing app folder"
+exit_on_error "finding and testing app folder"
 
 sep
 
 sudo bash "$FEISTY_MEOW_SCRIPTS/system/remove_apache_site.sh" "$DOMAIN_NAME"
 
 sep
 
 sudo bash "$FEISTY_MEOW_SCRIPTS/system/remove_apache_site.sh" "$DOMAIN_NAME"
-test_or_die "dropping apache site for: $DOMAIN_NAME"
+exit_on_error "dropping apache site for: $DOMAIN_NAME"
 
 # drop the shadow site too.
 shadow_domain="${APPLICATION_NAME}.cakelampvm.com"
 if [ "$shadow_domain" != "$DOMAIN_NAME" ]; then
   sudo bash "$FEISTY_MEOW_SCRIPTS/system/remove_apache_site.sh" "$shadow_domain"
 
 # drop the shadow site too.
 shadow_domain="${APPLICATION_NAME}.cakelampvm.com"
 if [ "$shadow_domain" != "$DOMAIN_NAME" ]; then
   sudo bash "$FEISTY_MEOW_SCRIPTS/system/remove_apache_site.sh" "$shadow_domain"
-  test_or_die "dropping shadow apache site on '$shadow_domain'"
+  exit_on_error "dropping shadow apache site on '$shadow_domain'"
 fi
 
 sep
 fi
 
 sep
@@ -75,7 +75,7 @@ sep
 #echo "!! domain being removed is: $DOMAIN_NAME"
 
 sudo bash "$FEISTY_MEOW_SCRIPTS/system/remove_domain.sh" "$DOMAIN_NAME"
 #echo "!! domain being removed is: $DOMAIN_NAME"
 
 sudo bash "$FEISTY_MEOW_SCRIPTS/system/remove_domain.sh" "$DOMAIN_NAME"
-test_or_die "dropping domain: $DOMAIN_NAME"
+exit_on_error "dropping domain: $DOMAIN_NAME"
 
 sep
 
 
 sep
 
index b400fcb98f556d52faf28ab2794f439800745dad..dc14f84e31ac97bc4ed80c65677cf68e86003392 100644 (file)
@@ -39,16 +39,16 @@ if [ -z "$SWAP_SIZE" ]; then
 fi
 
 /bin/dd if=/dev/zero of=/var/swap.${SWAP_INSTANCE} bs=1M count=${SWAP_SIZE}
 fi
 
 /bin/dd if=/dev/zero of=/var/swap.${SWAP_INSTANCE} bs=1M count=${SWAP_SIZE}
-test_or_die "creating swap file"
+exit_on_error "creating swap file"
 
 /bin/chmod 600 /var/swap.${SWAP_INSTANCE}
 
 /bin/chmod 600 /var/swap.${SWAP_INSTANCE}
-test_or_die "setting swap file permissions"
+exit_on_error "setting swap file permissions"
 
 /sbin/mkswap /var/swap.${SWAP_INSTANCE}
 
 /sbin/mkswap /var/swap.${SWAP_INSTANCE}
-test_or_die "formatting swap file as swap partition"
+exit_on_error "formatting swap file as swap partition"
 
 /sbin/swapon /var/swap.${SWAP_INSTANCE}
 
 /sbin/swapon /var/swap.${SWAP_INSTANCE}
-test_or_die "enabling new swap partition"
+exit_on_error "enabling new swap partition"
 
 free
 
 
 free
 
index 7f831e21aa4953214bdca0c13dc7044a73abd486..0deb72574e5f0c68fb7268bd1920ed146cc764fc 100644 (file)
@@ -17,7 +17,7 @@ function remove_domain_file()
   if [ -f "$domain_file" ]; then
     # don't destroy, just shuffle.
     \mv -f "$domain_file" "/tmp/$(basename ${domain_file})-old-${RANDOM}"
   if [ -f "$domain_file" ]; then
     # don't destroy, just shuffle.
     \mv -f "$domain_file" "/tmp/$(basename ${domain_file})-old-${RANDOM}"
-    test_or_die "removing domain file: $domain_file"
+    exit_on_error "removing domain file: $domain_file"
   else
     echo "Did not see a domain file to remove: $domain_file"
   fi
   else
     echo "Did not see a domain file to remove: $domain_file"
   fi
@@ -61,7 +61,7 @@ ${domain_name}.       IN A    ${IP_ADDRESS}
 
   # our personalized configuration approach wants the real owner to own the file.
   chown "$(logname):$(logname)" $domain_file
 
   # our personalized configuration approach wants the real owner to own the file.
   chown "$(logname):$(logname)" $domain_file
-  test_or_die "setting ownership on: $domain_file"
+  exit_on_error "setting ownership on: $domain_file"
 }
 
 # takes a zone back out of the local conf file for bind
 }
 
 # takes a zone back out of the local conf file for bind
@@ -100,7 +100,7 @@ zone \"${domain_name}\" in {
 
   # keep ownership for the real user.
   chown "$(logname):$(logname)" /etc/bind/named.conf.local
 
   # keep ownership for the real user.
   chown "$(logname):$(logname)" /etc/bind/named.conf.local
-  test_or_die "setting ownership on: /etc/bind/named.conf.local"
+  exit_on_error "setting ownership on: /etc/bind/named.conf.local"
 }
 
 # zaps a subdomain out of the containing domain file.
 }
 
 # zaps a subdomain out of the containing domain file.
@@ -170,7 +170,7 @@ function add_new_subdomain()
 
   # keep ownership for real user.
   chown "$(logname):$(logname)" "/etc/bind/${containing_domain}.conf"
 
   # keep ownership for real user.
   chown "$(logname):$(logname)" "/etc/bind/${containing_domain}.conf"
-  test_or_die "setting ownership on: /etc/bind/${containing_domain}.conf"
+  exit_on_error "setting ownership on: /etc/bind/${containing_domain}.conf"
 }
 
 function restart_bind()
 }
 
 function restart_bind()
@@ -217,7 +217,7 @@ function remove_apache_config()
   if [ -f "$site_config" ]; then
     # don't destroy, just shuffle.
     \mv -f "$site_config" "/tmp/$(basename ${site_config})-old-${RANDOM}"
   if [ -f "$site_config" ]; then
     # don't destroy, just shuffle.
     \mv -f "$site_config" "/tmp/$(basename ${site_config})-old-${RANDOM}"
-    test_or_die "removing site config: $site_config"
+    exit_on_error "removing site config: $site_config"
   else
     echo "Did not see a site config to remove: $site_config"
   fi
   else
     echo "Did not see a site config to remove: $site_config"
   fi
@@ -278,7 +278,7 @@ function write_apache_config()
 " >"$site_config" 
 
   chown "$(logname):$(logname)" "$site_config"
 " >"$site_config" 
 
   chown "$(logname):$(logname)" "$site_config"
-  test_or_die "setting ownership on: $site_config"
+  exit_on_error "setting ownership on: $site_config"
 }
 
 # stops apache from serving up the site.
 }
 
 # stops apache from serving up the site.
@@ -347,7 +347,7 @@ function maybe_create_site_storage()
   local full_path="$BASE_APPLICATION_PATH/$our_app"
   if [ ! -d "$full_path" ]; then
     mkdir -p $full_path
   local full_path="$BASE_APPLICATION_PATH/$our_app"
   if [ ! -d "$full_path" ]; then
     mkdir -p $full_path
-    test_or_die "The app storage path could not be created.\n  Path in question is: $full_path"
+    exit_on_error "The app storage path could not be created.\n  Path in question is: $full_path"
   fi
 
   # now give the web server some access to the folder.  this is crucial since the folders
   fi
 
   # now give the web server some access to the folder.  this is crucial since the folders
@@ -359,10 +359,10 @@ function maybe_create_site_storage()
   while [[ $chow_path != $HOME ]]; do
 #echo chow path is now $chow_path
     chmod g+rx "$chow_path"
   while [[ $chow_path != $HOME ]]; do
 #echo chow path is now $chow_path
     chmod g+rx "$chow_path"
-    test_or_die "Failed to add group permissions on the path: $chow_path"
+    exit_on_error "Failed to add group permissions on the path: $chow_path"
     # reassert the user's ownership of any directories we might have just created.
     chown $(logname) "$chow_path"
     # reassert the user's ownership of any directories we might have just created.
     chown $(logname) "$chow_path"
-    test_or_die "changing ownership to user failed on the path: $chow_path"
+    exit_on_error "changing ownership to user failed on the path: $chow_path"
     chow_path="$(dirname "$chow_path")"
   done
 }
     chow_path="$(dirname "$chow_path")"
   done
 }
index 7790fe884fe87a03602939d89a10c29aebf0306b..cf9cbf898228ec2908c65cef9673fd5ce8aa4232 100644 (file)
@@ -2,7 +2,7 @@
 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
 
 sudo apt-get update -y
 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
 
 sudo apt-get update -y
-test_or_die "problem while doing 'apt-get update'"
+exit_on_error "problem while doing 'apt-get update'"
 
 # newest magic to tell dpkg to go with existing config files and force non-interactive version.
 sudo bash -c "\
 
 # newest magic to tell dpkg to go with existing config files and force non-interactive version.
 sudo bash -c "\
@@ -10,6 +10,6 @@ sudo bash -c "\
   apt-get dist-upgrade -y -o Dpkg::Options::=\"--force-confdef\" \
      -o Dpkg::Options::=\"--force-confold\"; \
 "
   apt-get dist-upgrade -y -o Dpkg::Options::=\"--force-confdef\" \
      -o Dpkg::Options::=\"--force-confold\"; \
 "
-test_or_die "problem while doing 'apt-get dist-upgrade'"
+exit_on_error "problem while doing 'apt-get dist-upgrade'"