Merge branch 'dev' of feistymeow.org:feisty_meow into dev
authorFred T. Hamster <fred@gruntose.com>
Sat, 11 Nov 2017 22:24:06 +0000 (17:24 -0500)
committerFred T. Hamster <fred@gruntose.com>
Sat, 11 Nov 2017 22:24:06 +0000 (17:24 -0500)
production/feisty_meow_config.ini
scripts/core/functions.sh
scripts/core/generate_aliases.pl
scripts/core/launch_feisty_meow.sh
scripts/core/reconfigure_feisty_meow.sh
scripts/core/variables.sh
scripts/generator/show_version.sh [new file with mode: 0644]
scripts/rev_control/push_repo_downstream.sh
scripts/rev_control/version_control.sh
scripts/system/add_apache_site.sh
scripts/text/nechung_signature.sh

index 6415cf1e7c232665b49ce87f797c98c5b3a60c87..e59199d17313e41ecd12c07236a6246a58212f0e 100644 (file)
@@ -3,7 +3,7 @@
 # specifies the version of the code that is being constructed here.
 major=2
 minor=140
-revision=92
+revision=97
 build=420
 
 # specifies the remainder of the version record info.
index a66d19398960a4e9d896081bb2910e6ac539ad55..9dcfce80b35a5565c50868bf5f8cecb5707b24d9 100644 (file)
@@ -388,6 +388,7 @@ if [ -z "$skip_all" ]; then
       echo "The nechung oracle program cannot be found.  You may want to consider"
       echo "rebuilding the feisty meow applications with this command:"
       echo "bash $FEISTY_MEOW_SCRIPTS/generator/produce_feisty_meow.sh"
+      echo
     else
       $wheres_nechung
     fi
index a9c4043518db769c17edfe061c71cd92a2da14dc..4ed01fb74641794fe21613eeb98ee0d4e35d1513 100644 (file)
@@ -94,11 +94,13 @@ sub rebuild_script_aliases {
   }
   if (length($DEBUG_FEISTY_MEOW)) {
     print "using these alias files:\n";
+print "HEY IS THIS PROBLEM CHILD?\n";
     foreach $i (@ALIAS_DEFINITION_FILES) {
       local $base_of_dir = &basename(&dirname($i));
       local $basename = &basename($i);
       print "  $base_of_dir/$basename\n";
     }
+print "WAS PROBLEM CHILD ABOVE HERE?\n";
   }
 
   # write the aliases for sh and bash scripts.
index 82eb5a7fcbd466739e001ca166258d2366fc7632..241e2a0f1be5f39093c916515594bedf33c98bc7 100644 (file)
 
 ##############
 
-# some preconditions we want to establish before loading anything...
+# this script cannot handle figuring out where it lives, so approaches that
+# get the WORKDIR will fail.  this is a consequence of this always being used
+# in bash's 'source' directive, which does not pass the script name as
+# argument 0.  instead, we just check for the bad condition of a malconfigured
+# script system and try to repair it.
 
-# make sure that aliases can be used in non-interactive shells.
-shopt -s expand_aliases
+# we start out thinking things are good.
+NO_REPAIRS_NEEDED=true
 
-# patch the user variable if we were launched by one of our cron jobs.
-if [ -z "$USER" -a ! -z "$CRONUSER" ]; then
-  export USER="$CRONUSER"
-fi
+# check if any crucial folder is hosed.  we will torch the existing config
+# to the extent we can.
+if [ ! -d "$FEISTY_MEOW_APEX" ]; then
+  # flag some problems.
+  unset NO_REPAIRS_NEEDED
+  # wipe out the offending variable(s).
+  unset FEISTY_MEOW_SCRIPTS FEISTY_MEOW_APEX
+  # clean out any unfortunate wrongness that may exist in our generated areas.
+  if [ -d "$FEISTY_MEOW_LOADING_DOCK" ]; then \rm -rf "$FEISTY_MEOW_LOADING_DOCK"; fi
+  if [ -d "$FEISTY_MEOW_GENERATED_STORE" ]; then \rm -rf "$FEISTY_MEOW_GENERATED_STORE"; fi
+  # also wipe any values from the variables pointing at generated stuff.
+  unset FEISTY_MEOW_LOADING_DOCK FEISTY_MEOW_GENERATED_STORE
+  echo "
 
-##############
+The feisty meow configuration is damaged somehow.  Please change to the
+directory where it is stored, e.g.:
 
-export ERROR_OCCURRED=
-  # there have been no errors to start with, at least.  we will set this
-  # to non-empty if something bad happens.
-
-if [ -z "$FEISTY_MEOW_LOADING_DOCK" ]; then
-  # FEISTY_MEOW_LOADING_DOCK is where the generated files are located.
-  # this is our single entry point we can use without knowing any variables
-  # yet in the initialization process.
-  export FEISTY_MEOW_LOADING_DOCK="$HOME/.zz_feisty_loading"
-#hmmm: the above is kind of a constant.  that's not so great.
-
-  # make sure our main variables are established.
-  FEISTY_MEOW_VARIABLES_LOADING_FILE="$FEISTY_MEOW_LOADING_DOCK/fmc_variables.sh"
-  if [ ! -f "$FEISTY_MEOW_VARIABLES_LOADING_FILE" ]; then
-    echo -e "\
-
-The feisty meow scripts need initialization via the bootstrap process.  For\n\
-example, if the feisty meow folder lives in '$DEFAULT_FEISTYMEOW_ORG_DIR', then this\n\
-command bootstraps feisty meow:\n\
-\n\
-  bash $example_dir/feisty_meow/scripts/core/reconfigure_feisty_meow.sh\n\
-\n\
-\n"
-    ERROR_OCCURRED=true
-  fi
+  cd /opt/feistymeow.org/feisty_meow
 
-  ##############
+and run this command (the whole unwieldy multiple line chunk inside the bars):
 
-  if [ -z "$ERROR_OCCURRED" ]; then
 
-    # pull in our generated variables that are the minimal set we need to find
-    # the rest of our resources.
-    source "$FEISTY_MEOW_VARIABLES_LOADING_FILE"
+##############
+  exec bash -i 3<<EOF 4<&0 <&3
+    echo -e '\n\n^^^ errors above here indicate potential problems in .bashrc ^^^';
+    export FEISTY_MEOW_APEX=\"\$(pwd)\"; export FEISTY_MEOW_SCRIPTS=\$FEISTY_MEOW_APEX/scripts;
+    export FEISTY_MEOW_SHOW_LAUNCH_GREETING=yes;
+    /bin/bash \$(pwd)/scripts/core/reconfigure_feisty_meow.sh;
+    source \$(pwd)/scripts/core/launch_feisty_meow.sh; exec 3>&- <&4
+EOF
+##############
 
-    # Set up the temporary directory.
-    source "$FEISTY_MEOW_SCRIPTS/core/create_tempdir.sh"
-  fi
 
+This code snippet assumes that the .bashrc file could still need editing to
+fix an erroneous FEISTY_MEOW_APEX variable, so we skip it above when bash
+runs.  Check \$HOME/.bashrc to see if a change there will fix the problem.
+
+"
+else
+  # apex is good, so let's make the scripts good too.
+  if [ ! -d "$FEISTY_MEOW_SCRIPTS" ]; then
+    export FEISTY_MEOW_SCRIPTS="$FEISTY_MEOW_APEX/scripts"
+  fi
+  # check again to test our belief system...
+  if [ ! -d "$FEISTY_MEOW_SCRIPTS" ]; then
+    unset NO_REPAIRS_NEEDED
+    echo -e "The feisty meow scripts cannot be found under the current top:\n  FEISTY_MEOW_APEX=$FEISTY_MEOW_APEX"
+  fi
 fi
 
-##############
+#; /bin/bash -i --norc --noprofile\" > \$HOME/fm-fix 
+#; exec /bin/bash -i --norc --noprofile -c 'bash \$HOME/fm-fix ; echo hello ; read line'
+#--norc --noprofile 
+#; source \$FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh
 
-if [ -z "$ERROR_OCCURRED" ]; then
+if [ "$NO_REPAIRS_NEEDED" == "true" ]; then
 
-  # load the larger body of standard feisty meow variables into the environment.
-  # we actually want this to always run also; it will decide what variables need
-  # to be set again.
-  source "$FEISTY_MEOW_SCRIPTS/core/variables.sh"
+  # we believe it's safe to run through the rest of this script.
 
   ##############
   
-  # include helpful functions.  we do this every time rather than making it part
-  # of variable initialization, because functions cannot be exported to
-  # sub-shells in bash.
-  source "$FEISTY_MEOW_SCRIPTS/core/functions.sh"
+  # some preconditions we want to establish before loading anything...
   
-  # load some helper methods for the terminal which we'll use below.
-  source "$FEISTY_MEOW_SCRIPTS/tty/terminal_titler.sh"
-
-  ##############
+  # make sure that aliases can be used in non-interactive shells.
+  shopt -s expand_aliases
   
-  # check hash table before searching path.
-  shopt -s checkhash
-  # don't check path for sourced files.
-  shopt -u sourcepath
-  # ignore duplicate lines.
-  HISTCONTROL=ignoredups
-  # append to the history file.
-  shopt -s histappend
-  # automatically update window size if needed.
-  shopt -s checkwinsize
-
-  ##############
-
-  # make history writes immediate to avoid losing history if bash is zapped.
-  echo $PROMPT_COMMAND | grep -q history
-  if [ $? -ne 0 ]; then
-    # we only change the prompt command if we think it hasn't already been done.
-    export PROMPT_COMMAND="history -a;$PROMPT_COMMAND"
+  # patch the user variable if we were launched by one of our cron jobs.
+  if [ -z "$USER" -a ! -z "$CRONUSER" ]; then
+    export USER="$CRONUSER"
   fi
   
   ##############
   
-  # perform the bulkier parts of the initialization process.
+  export ERROR_OCCURRED=
+    # there have been no errors to start with, at least.  we will set this
+    # to non-empty if something bad happens.
+  
+  if [ -z "$FEISTY_MEOW_LOADING_DOCK" ]; then
+    # FEISTY_MEOW_LOADING_DOCK is where the generated files are located.
+    # this is our single entry point we can use without knowing any variables
+    # yet in the initialization process.
+    export FEISTY_MEOW_LOADING_DOCK="$HOME/.zz_feisty_loading"
+  #hmmm: the above is kind of a constant.  that's not so great.
   
-  if [ ! -z "$DEBUG_FEISTY_MEOW" ]; then echo "heavyweight init begins..."; fi
+    # make sure our main variables are established.
+    FEISTY_MEOW_VARIABLES_LOADING_FILE="$FEISTY_MEOW_LOADING_DOCK/fmc_variables.sh"
+    if [ ! -f "$FEISTY_MEOW_VARIABLES_LOADING_FILE" ]; then
+      echo -e "\
   
-  # set up the aliases for the shell, but only if they are not already set.
-  type CORE_ALIASES_LOADED &>/dev/null
-  if [ $? -ne 0 ]; then
-    if [ ! -z "$DEBUG_FEISTY_MEOW" ]; then
-      echo "the aliases were missing, now they are being added..."
+  The feisty meow scripts need initialization via the bootstrap process.  For\n\
+  example, if the feisty meow folder lives in '$DEFAULT_FEISTYMEOW_ORG_DIR', then this\n\
+  command bootstraps feisty meow:\n\
+  \n\
+    bash $example_dir/feisty_meow/scripts/core/reconfigure_feisty_meow.sh\n\
+  \n\
+  \n"
+      ERROR_OCCURRED=true
     fi
-    source "$FEISTY_MEOW_LOADING_DOCK/fmc_core_and_custom_aliases.sh"
-  fi
   
-  #echo before the new labelling, terminal titles have:
-  #show_terminal_titles
+    ##############
   
-  # a minor tickle of the title of the terminal, unless we already have some history.
-  label_terminal_with_info
+    if [ -z "$ERROR_OCCURRED" ]; then
   
-  if [ ! -z "$DEBUG_FEISTY_MEOW" ]; then echo "heavyweight init is done."; fi
+      # pull in our generated variables that are the minimal set we need to find
+      # the rest of our resources.
+      source "$FEISTY_MEOW_VARIABLES_LOADING_FILE"
   
+      # Set up the temporary directory.
+      source "$FEISTY_MEOW_SCRIPTS/core/create_tempdir.sh"
+    fi
+  
+  fi
+
+  ##############
+
   if [ -z "$ERROR_OCCURRED" ]; then
-    # set a sentinel variable to say we loaded the feisty meow environment.
-    export FEISTY_MEOW_SCRIPTS_LOADED=true
+
+    # load the larger body of standard feisty meow variables into the environment.
+    # we actually want this to always run also; it will decide what variables need
+    # to be set again.
+    source "$FEISTY_MEOW_SCRIPTS/core/variables.sh"
+
+    ##############
+
+    # include helpful functions.  we do this every time rather than making it part
+    # of variable initialization, because functions cannot be exported to
+    # sub-shells in bash.
+    source "$FEISTY_MEOW_SCRIPTS/core/functions.sh"
+
+    # load some helper methods for the terminal which we'll use below.
+    source "$FEISTY_MEOW_SCRIPTS/tty/terminal_titler.sh"
+
+    ##############
+
+    # check hash table before searching path.
+    shopt -s checkhash
+    # don't check path for sourced files.
+    shopt -u sourcepath
+    # ignore duplicate lines.
+    HISTCONTROL=ignoredups
+    # append to the history file.
+    shopt -s histappend
+    # automatically update window size if needed.
+    shopt -s checkwinsize
+
+    ##############
+
+    # make history writes immediate to avoid losing history if bash is zapped.
+    echo $PROMPT_COMMAND | grep -q history
+    if [ $? -ne 0 ]; then
+      # we only change the prompt command if we think it hasn't already been done.
+      export PROMPT_COMMAND="history -a;$PROMPT_COMMAND"
+    fi
+
+    ##############
+
+    # perform the bulkier parts of the initialization process.
+
+    if [ ! -z "$DEBUG_FEISTY_MEOW" ]; then echo "heavyweight init begins..."; fi
+
+    # set up the aliases for the shell, but only if they are not already set.
+    type CORE_ALIASES_LOADED &>/dev/null
+    if [ $? -ne 0 ]; then
+      if [ ! -z "$DEBUG_FEISTY_MEOW" ]; then
+        echo "the aliases were missing, now they are being added..."
+      fi
+      source "$FEISTY_MEOW_LOADING_DOCK/fmc_core_and_custom_aliases.sh"
+    fi
+
+    #echo before the new labelling, terminal titles have:
+    #show_terminal_titles
+
+    # a minor tickle of the title of the terminal, unless we already have some history.
+    label_terminal_with_info
+
+    if [ ! -z "$DEBUG_FEISTY_MEOW" ]; then echo "heavyweight init is done."; fi
+
+    if [ -z "$ERROR_OCCURRED" ]; then
+      # set a sentinel variable to say we loaded the feisty meow environment.
+      export FEISTY_MEOW_SCRIPTS_LOADED=true
+    fi
+
+  fi  # no error occurred.
+
+  if [ ! -z "$FEISTY_MEOW_SHOW_LAUNCH_GREETING" ]; then
+    echo
+    echo
+    echo "welcome to the feisty meow zone of peace, one of many refuges in the uncountably"
+    echo "infinite multiverses that are hypothetically possible."
+    echo
+    echo
+    unset FEISTY_MEOW_SHOW_LAUNCH_GREETING
   fi
 
-fi  # no error occurred.
+fi # "$NO_REPAIRS_NEEDED" was == "true" 
 
index bcf187acd89bdde42fbc38460a27b7cacee590e1..b6421224607bcd18d5fd39ca55e630eff0046113 100644 (file)
@@ -21,6 +21,9 @@ source "$CORE_SCRIPTS_DIR/functions.sh"
 export FEISTY_MEOW_APEX="$(/bin/pwd)"
 #echo feisty now is FEISTY_MEOW_APEX=$FEISTY_MEOW_APEX
 
+# make the variables script run again.
+unset CORE_VARIABLES_LOADED
+
 # repetitive bit stolen from variables.  should make a file out of this somehow.
 IS_DOS=$(uname | grep -i ming)
 if [ -z "$IS_DOS" ]; then IS_DOS=$(uname | grep -i cygwin); fi
@@ -42,7 +45,12 @@ if [ ! -d "$FEISTY_MEOW_LOADING_DOCK" ]; then
   mkdir -p "$FEISTY_MEOW_LOADING_DOCK"
 fi
 # need to add some paths explicitly until we've bootstrapped ourselves.
-export PERLLIB=$PERLLIB:"$FEISTY_MEOW_SCRIPTS/files":"$FEISTY_MEOW_SCRIPTS/generator"
+#hmmm: this is tasty reusable code...
+export PERLLIB=$(echo $PERLLIB | sed -e "s?\([:]*\)\([^:]*feisty_meow[^:]*\)\([:]*\)??g")
+
+PERLLIB=$PERLLIB:"$FEISTY_MEOW_SCRIPTS/core":"$FEISTY_MEOW_SCRIPTS/files":"$FEISTY_MEOW_SCRIPTS/generator"
+PERL5LIB=$PERLLIB
+#echo PERLLIB after modification is $PERLLIB
 # make toast out of generated files right away, but leave any custom scripts.
 find "$FEISTY_MEOW_LOADING_DOCK" -maxdepth 1 -type f -exec perl "$FEISTY_MEOW_SCRIPTS/files/safedel.pl" "{}" ';'
 # &>/dev/null
@@ -61,11 +69,13 @@ done
 # load our variables so we can run our perl scripts successfully.
 source "$FEISTY_MEOW_SCRIPTS/core/variables.sh"
 
-# create our common aliases.
-perl "$FEISTY_MEOW_SCRIPTS/core/generate_aliases.pl"
+# create our common aliases.  we need to refresh the PERLLIB since the shell
+# seems to keep accumulating the value in a weird way.
+PERLLIB=$PERLLIB PERL5LIB=$PERLLIB perl "$FEISTY_MEOW_SCRIPTS/core/generate_aliases.pl"
+#echo after the generate aliases, perllib is $PERLLIB
 
 if [ ! -z "$DEBUG_FEISTY_MEOW" ]; then
-  echo established these variables for feisty_meow assets:
+  echo this is the variable config file for feisty_meow assets:
   echo ==============
   cat "$FEISTY_MEOW_VARIABLES_LOADING_FILE"
   echo ==============
index e743345d94cd70a7b3d4ae473032efae9d2645e7..b6311dacff8517b02357178abcc4ff9a3f09ab6f 100644 (file)
@@ -175,7 +175,6 @@ define_yeti_variable DEFAULT_FEISTYMEOW_ORG_DIR=/opt/feistymeow.org
   # variables for perl.
   
   define_yeti_variable PERLLIB+="/usr/lib/perl5"
-  define_yeti_variable PERL5LIB+="/usr/lib/perl5"
   if [ "$OS" == "Windows_NT" ]; then
     define_yeti_variable PERLIO=:perlio
       # choose perl's IO over the ms-windows version so we can handle file
@@ -190,10 +189,10 @@ define_yeti_variable DEFAULT_FEISTYMEOW_ORG_DIR=/opt/feistymeow.org
       ls $i/*.pl &>/dev/null
       if [ $? -eq 0 ]; then
         PERLLIB+=":$(dos_to_unix_path $i)"
-        PERL5LIB+=":$(dos_to_unix_path $i)"
       fi
     fi
   done
+  define_yeti_variable PERL5LIB=$PERLLIB
   #echo PERLLIB is now $PERLLIB
   
   ##############
diff --git a/scripts/generator/show_version.sh b/scripts/generator/show_version.sh
new file mode 100644 (file)
index 0000000..5091b64
--- /dev/null
@@ -0,0 +1,99 @@
+#!/bin/bash
+
+# increments the build version number.
+
+#mkdir -p "$TEMPORARIES_PILE"
+
+#hmmm: looks like repeated reusable code below (compare with next_version)
+export PARAMETER_FILE
+if [ ! -z "$BUILD_PARAMETER_FILE" ]; then
+  # define our version of the build parameter file.  this should be set
+  # beforehand so we override the default parameter file for clam.
+  PARAMETER_FILE="$BUILD_PARAMETER_FILE"
+fi
+if [ -z "$PARAMETER_FILE" ]; then
+  # last ditch attempt to get one that will work.
+  PARAMETER_FILE="$FEISTY_MEOW_APEX/build.ini"
+fi
+
+#chmod u+w "$PARAMETER_FILE"
+
+#new_buildini="$(mktemp "$TEMPORARIES_PILE/buildini.XXXXXX")"
+## whack the file just in case.
+#rm -f "$new_buildini"
+#echo -n "" >"$new_buildini"
+
+# pick a weird separator that we hope never to see.
+IFS='~'
+
+found_version=""
+skip_line=""
+
+major_string=
+minor_string=
+revision_string=
+
+#hmmm: now i know i'm having deja vu.  this loop is a big chunk of reusable code that should be abstracted from this file and from next_version
+
+while read line_found; do
+  if [ $? != 0 ]; then break; fi
+#echo line found is $line_found
+  if [ ! -z "$skip_line" ]; then
+    # we were told to skip this line to fix win32.
+    skip_line=""
+    continue
+  fi
+
+  # these checks don't care about whether we've seen other stuff yet.
+  if [ -z "$major_string" ]; then
+    if [ ! -z "$(echo $line_found | sed -n -e 's/^ *major *=.*$/yep/p')" ]; then
+      major_string=$(echo $line_found | sed -e 's/.*=\(.*\)$/\1/' )
+    fi
+  fi
+  if [ -z "$minor_string" ]; then
+    if [ ! -z "$(echo $line_found | sed -n -e 's/^ *minor *=.*$/yep/p')" ]; then
+      minor_string=$(echo $line_found | sed -e 's/.*=\(.*\)$/\1/' )
+    fi
+  fi
+
+  # we process the revision string line specially.
+  if [ -z "$found_version" ]; then
+       if [ "$line_found" == "#[version]" ]; then
+         # repair our special escape that makes this a valid ini file and
+         # gnu make include file.
+#        echo -e "#\\\\\n[version]" >>"$new_buildini"
+         found_version="yes"
+      continue
+       elif [ "$line_found" == "#" ]; then
+         # retarded win32 case.
+#        echo -e "#\\\\\n[version]" >>"$new_buildini"
+         found_version="yes"
+         skip_line="yes"
+      continue
+       fi
+  elif [ -z "$revision_string" ]; then
+    if [ ! -z "$(echo $line_found | sed -n -e 's/^ *revision *=.*$/yep/p')" ]; then
+      revision_string=$(echo $line_found | sed -e 's/.*=\(.*\)$/\1/' )
+#echo second part is $revision_string 
+      revision_string=$(expr $revision_string + 1)
+#      echo "revision=$revision_string" >>"$new_buildini"
+      # don't print the line normally also.
+      continue
+    fi
+  fi
+
+  # send the line with no special processing.
+#  echo "$line_found" >>"$new_buildini"
+
+done <"$PARAMETER_FILE"
+
+## if we created something with contents, let's use it.
+#if [ -s "$new_buildini" ]; then
+#  cp "$new_buildini" "$PARAMETER_FILE"
+#fi
+
+echo "Current build version is: $major_string.$minor_string.$revision_string"
+
+# don't leave the temporary version files floating around.
+#rm -f "$new_buildini"
+
index aacd77724b2e25f58973e569de6fd9946fecdf81..b2da88704a60f4ace4290f638e8be69cc1eb6030 100644 (file)
@@ -47,9 +47,8 @@ pushd "$dir" &>/dev/null
 test_or_die "changing to directory: $dir"
 tempfile=$(generate_rev_ctrl_filelist)
 test_or_die "generating revision control file list"
-popd &>/dev/null
 
-perform_revctrl_action_on_file "$tempfile" do_careful_git_update "$(\pwd)"
+perform_revctrl_action_on_file "$tempfile" do_careful_git_update
 test_or_die "doing a careful git update on: $tempfile"
 
 # send our little boat down the stream to the dependent repository.
index 7dd199f4c44632623c3d3b123ffda0909b12983e..491dd17c1cc9ed5439eea6461f194ba381b13cd9 100644 (file)
@@ -23,6 +23,15 @@ fi
 
 ##############
 
+#hmmm: move this to core
+# this makes the status of pipe N into the main return value.
+function promote_pipe_return()
+{
+  ( exit ${PIPESTATUS[$1]} )
+}
+
+##############
+
 # one unpleasantry to take care of first; cygwin barfs aggressively if the TMP directory
 # is a DOS path, but we need it to be a DOS path for our GFFS testing, so that blows.
 # to get past this, TMP gets changed below to a hopefully generic and safe place.
@@ -77,7 +86,8 @@ function do_checkin()
       $blatt
 
       # put all changed and new files in the commit.  not to everyone's liking.
-      git add --all .
+      git add --all . | $TO_SPLITTER
+      promote_pipe_return 0
       test_or_die "git add all new files"
 
       # see if there are any changes in the local repository.
@@ -95,6 +105,7 @@ function do_checkin()
 
       # upload any changes to the upstream repo so others can see them.
       git push origin "$(my_branch_name)" 2>&1 | grep -v "X11 forwarding request failed" | $TO_SPLITTER
+      promote_pipe_return 0
       test_or_die "git push"
 
     fi
@@ -285,7 +296,8 @@ function do_careful_git_update()
   fi
 
   # first update all our remote branches to their current state from the repos.
-  git remote update
+  git remote update | $TO_SPLITTER
+  promote_pipe_return 0
   test_or_die "git remote update"
 
   local this_branch="$(my_branch_name)"
@@ -299,7 +311,8 @@ function do_careful_git_update()
   local bran
   for bran in $branch_list; do
 #    echo "synchronizing remote branch: $bran"
-    git checkout "$bran"
+    git checkout "$bran" | $TO_SPLITTER
+    promote_pipe_return 0
     test_or_die "git switching checkout to remote branch: $bran"
 
     state=$(check_branch_state "$bran")
@@ -308,17 +321,20 @@ function do_careful_git_update()
     remote_branch_info=$(git ls-remote --heads origin $bran 2>/dev/null)
     if [ ! -z "$remote_branch_info" ]; then
       # we are pretty sure the remote branch does exist.
-      git pull --no-ff origin "$bran"
+      git pull --no-ff origin "$bran" | $TO_SPLITTER
+      promote_pipe_return 0
     fi
     test_or_die "git pull of remote branch: $bran"
   done
   # now switch back to our branch.
-  git checkout "$this_branch"
+  git checkout "$this_branch" | $TO_SPLITTER
+  promote_pipe_return 0
   test_or_die "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.
-  git pull --no-ff --all
+  git pull --no-ff --all | $TO_SPLITTER
+  promote_pipe_return 0
   test_or_die "git pulling all upstream"
 
   popd &>/dev/null
@@ -343,19 +359,21 @@ function do_update()
     if test_writeable "CVS"; then
       $blatt
       cvs update . | $TO_SPLITTER
+      promote_pipe_return 0
       test_or_die "cvs update"
     fi
   elif [ -d ".svn" ]; then
     if test_writeable ".svn"; then
       $blatt
       svn update . | $TO_SPLITTER
+      promote_pipe_return 0
       test_or_die "svn update"
     fi
   elif [ -d ".git" ]; then
     if test_writeable ".git"; then
       $blatt
       git pull --no-ff 2>&1 | grep -v "X11 forwarding request failed" | $TO_SPLITTER
-      if [ ${PIPESTATUS[0]} -ne 0 ]; then false; fi
+      promote_pipe_return 0
       test_or_die "git pull of origin without fast forwards"
     fi
   else
@@ -450,7 +468,7 @@ function perform_revctrl_action_on_file()
     pushd "$dirname" &>/dev/null
     echo "[$(pwd)]"
     # pass the current directory plus the remaining parameters from function invocation.
-    $action . $*
+    $action . 
     test_or_die "performing action $action on: $(pwd)"
     sep 28
     popd &>/dev/null
index 6b0956347d17406dc8ddc28e19354e89f1d6cea1..e99f371a1dec349de0c82cb79635c132d2044c42 100644 (file)
@@ -16,6 +16,8 @@ function write_apache_config()
 {
   local appname="$1"; shift
   local sitename="$1"; shift
+  local site_path="$1"; shift
+
   local site_config="/etc/apache2/sites-available/${sitename}.conf"
 
   # check if config file already exists and bail if so.
@@ -30,12 +32,19 @@ function write_apache_config()
   echo "Creating a new apache2 site for $sitename with config file:"
   echo "  $site_config"
 
-  # path where site gets checked out, in some arcane manner, and which happens to be
-  # above the path where we put webroot (in the storage suffix, if defined).
-  local path_above="${BASE_PATH}/${appname}"
-  # no slash between appname and suffix, in case suffix is empty.
-  local full_path="${BASE_PATH}/${appname}${STORAGE_SUFFIX}"
+  # if no path, then we default to our standard app storage location.  otherwise, we
+  # put the site where they told us to.
+  if [ -z "$site_path" ]; then
+    # path where site gets checked out, in some arcane manner, and which happens to be
+    # above the path where we put webroot (in the storage suffix, if defined).
+    local path_above="${BASE_PATH}/${appname}"
+    # no slash between appname and suffix, in case suffix is empty.
+    local full_path="${path_above}${STORAGE_SUFFIX}"
 #echo really full path is $full_path
+  else
+    # we'll go with their specification for the site storage.
+    local full_path="$site_path"
+  fi
 
   echo "
 # set up the user's web folder as an apache user web directory.
@@ -125,16 +134,24 @@ fi
 
 appname="$1"; shift
 site="$1"; shift
+site_path="$1"; shift
 
 if [ -z "$appname" -o -z "$site" ]; then
-  echo "This script needs to know (1) the appname (application name) for the new"
-  echo "site and (2) the DNS name for the apache virtual host."
-  echo "The appname should work as a file-system compatible folder name."
+#hmmm: move to a print_instructions function.
+  echo "
+$(basename $0): {app name} {dns name} [site path]
+
+This script needs to know (1) the application name for the new site and
+(2) the DNS name for the apache virtual host.  The appname should be an
+appropriate name for a file-system compatible folder name.  There is an
+optional third parameter (3) the path for site storage.  If the site path
+is not provided, we'll use this path:
+  $BASE_PATH/{app name}/$STORAGE_SUFFIX"
   exit 1
 fi
 
 maybe_create_site_storage "$appname"
-write_apache_config "$appname" "$site"
+write_apache_config "$appname" "$site" "$site_path"
 enable_site "$site"
 restart_apache
 
index 42448571b287ca0754373dece69cd224d7ebe274..3ee02f4b392f67f8778294f578ea30d0801b235a 100644 (file)
@@ -4,4 +4,3 @@ echo "<br>"
 echo "--<br>"
 $FEISTY_MEOW_BINARIES/nechung
 
-