Merge branch 'master' of feistymeow.org:feisty_meow into dev
authorChris Koeritz <fred@gruntose.com>
Sun, 12 Nov 2017 04:26:40 +0000 (23:26 -0500)
committerChris Koeritz <fred@gruntose.com>
Sun, 12 Nov 2017 04:26:40 +0000 (23:26 -0500)
infobase/feisty_inits/dot.bashrc-root
scripts/core/common.alias
scripts/core/connect_feisty_meow.sh
scripts/rev_control/version_control.sh
scripts/site_avenger/standup.sh

index 20a9023fadd3d1f596d6dc5f35b807923395a661..1b1dd1e23b279db6c64416b4c609fee2fd0c843f 100644 (file)
@@ -26,6 +26,8 @@ export FEISTY_MEOW_APEX="/opt/feistymeow.org/feisty_meow"
 
 # the "fredme" macro enables the feisty_meow environment.
 alias fredme='source "$FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh"'
+# synonym for fredme.
+alias feistyme='source "$FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh"'
 
 # if not commented out, then feisty meow will run all the unit tests during builds.
 #export RUN_ALL_TESTS=true
index 1a830c84288a9b9a6f42c65c233460567226029d..e311dc28bff7a691a3dec4d2cf7b081bea511dcf 100644 (file)
@@ -79,6 +79,12 @@ define_yeti_alias up='cd ..'
 
 ##############
 
+# some information about the feisty meow codebase itself.
+
+define_yeti_alias feisty_branch='pushd $FEISTY_MEOW_APEX ; git branch ; popd'
+
+##############
+
 # extended aliases for meta-operations.
 define_yeti_alias dvd_rip='vobcopy -m'
 define_yeti_alias blu_rip='echo "what would this command be?"'
index 9a5c81d548bb3b98b6b22e36a3009641f6cdb868..6a226b8dfe3e8c15b4c670e084a2f89154922c58 100644 (file)
@@ -11,16 +11,31 @@ export FEISTY_MEOW_APEX="$( \cd "$WORKDIR/../.." && \pwd )"
 
 echo calculated apex as $FEISTY_MEOW_APEX
 
+do_root="$1"; shift
+
 if [ -f "$HOME/.bashrc" ] && grep -q "launch_feisty_meow.sh" "$HOME/.bashrc"; then
   # the stanza for loading feisty meow already seems to be present.
   echo "Feisty Meow already seems to be configured in '~/.bashrc'."
 else
-  # stuff the normal user init file into .bashrc.  not appropriate for root probably, but
-  # this is the easy quick start script for normal folks.
-  cat $FEISTY_MEOW_APEX/infobase/feisty_inits/dot.bashrc-normal-user |
-    sed -e \
-      "s?FEISTY_MEOW_APEX=\".*\"?FEISTY_MEOW_APEX=\"$FEISTY_MEOW_APEX\"?" \
-      >> "$HOME/.bashrc"
-  echo "Feisty Meow is now configured in '~/.bashrc'."
+  # check for the --root flag to see if they're trying to get the root version of inits.
+  if [ "$do_root" != "--root" ]; then
+    # stuff the "normal user" init file into .bashrc.  not appropriate for root.
+    # this is the easy and quick start script for most folks.
+    cat $FEISTY_MEOW_APEX/infobase/feisty_inits/dot.bashrc-normal-user |
+      sed -e \
+        "s?FEISTY_MEOW_APEX=\".*\"?FEISTY_MEOW_APEX=\"$FEISTY_MEOW_APEX\"?" \
+        >> "$HOME/.bashrc"
+    echo "Feisty Meow is now configured in '~/.bashrc' for standard users."
+  else
+    # stuff the root user init file into .bashrc.  this one doesn't automatically load
+    # feisty meow.  instead, it provides a fredme macro to load the feisty meow scripts.
+    # fredme comes from the main author being fred t. hamster.  we have since added a
+    # feistyme macro too, to be less personalized...
+    cat $FEISTY_MEOW_APEX/infobase/feisty_inits/dot.bashrc-root |
+      sed -e \
+        "s?FEISTY_MEOW_APEX=\".*\"?FEISTY_MEOW_APEX=\"$FEISTY_MEOW_APEX\"?" \
+        >> "$HOME/.bashrc"
+    echo "Feisty Meow is now configured in '~/.bashrc' for the root user."
+  fi
 fi
 
index 3e8ef4c430a36a706bf00437fb730e848a5d8d27..1d8b56083717c4a0b120cdcbb9a848a2f4ec0039 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
@@ -426,8 +444,8 @@ function generate_rev_ctrl_filelist()
 
   local sortfile=$(mktemp /tmp/zz_checkin_sort.XXXXXX)
   sort <"$tempfile" >"$sortfile"
-  \rm "$tempfile"
   echo "$sortfile"
+  \rm "$tempfile" "$sortfile"
 }
 
 # iterates across a list of directories contained in a file (first parameter).
index 762bd1ef6e8ba20e26e171fa99f7c6757fecbb66..2ae953bb53409badf3ae85cafce07eee893d513f 100644 (file)
@@ -53,77 +53,9 @@ test_or_die "Setting up apache site for: $APPLICATION_NAME"
 
 powerup "$APPLICATION_NAME" "$REPO_NAME" "$THEME_NAME"
 
-
-
-
-
 sep
 
 echo "
 Finished standing up the full domain and site in:
 ${app_dirname}"
 
-#leave before old crud below
-exit 0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-#below is probably not needed.
-# find proper webroot where the site will be initialized.
-if [ -z "$app_dirname" ]; then
-  # no dir was passed, so guess it.
-  find_app_folder "$APPLICATION_DIR"
-else
-  test_app_folder "$APPLICATION_DIR" "$app_dirname"
-fi
-
-# where we expect to find our checkout folder underneath.
-full_app_dir="$APPLICATION_DIR/$app_dirname"
-
-# use our default values for the repository and theme if they're not provided.
-if [ -z "$repo_name" ]; then
-  repo_name="$app_dirname"
-fi
-if [ -z "$theme_name" ]; then
-  theme_name="$(capitalize_first_char ${app_dirname})"
-fi
-
-echo "Repository: $repo_name"
-echo "Theme name: $theme_name"
-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"
-test_or_die "Updating the repository storage directory"
-
-# update the site to load dependencies.
-sep
-composer_repuff "$site_store_path"
-test_or_die "Installing site dependencies with composer"
-
-# set up the symbolic links needed to achieve siteliness.
-sep
-
-create_site_links "$site_store_path" "$theme_name"
-
-sep
-
-echo "Finished powering up the site in '${app_dirname}'."
-