cleaning up revision control tools
authorChris Koeritz <fred@gruntose.com>
Fri, 3 Nov 2017 05:19:14 +0000 (01:19 -0400)
committerChris Koeritz <fred@gruntose.com>
Fri, 3 Nov 2017 05:19:14 +0000 (01:19 -0400)
tried to move to a consistent naming scheme.  getem and checkin are the "grab the code" and "check the code in" operations.  so rgetem and rcheckin are the recursive versions of those that act on a whole hierarchy.  other scripts have been renamed for easier understanding of what the heck they do.  some junk scripts have been flushed out.

19 files changed:
infobase/configuration/cron/synch_and_swim_downstream.crontab
scripts/archival/shared_updater_parts.sh
scripts/core/functions.sh
scripts/files/cleanerator.sh [deleted file]
scripts/rev_control/diff_repo.sh [new file with mode: 0644]
scripts/rev_control/fix_ssh_perms.sh [deleted file]
scripts/rev_control/fix_svn_item.sh [deleted file]
scripts/rev_control/rcheckin.sh [new file with mode: 0644]
scripts/rev_control/report_new.sh [new file with mode: 0644]
scripts/rev_control/resolve_svn.sh [new file with mode: 0644]
scripts/rev_control/rev_checkin.sh [deleted file]
scripts/rev_control/rev_diff.sh [deleted file]
scripts/rev_control/rev_report_new.sh [deleted file]
scripts/rev_control/rev_update.sh [deleted file]
scripts/rev_control/rgetem.sh [new file with mode: 0644]
scripts/rev_control/svn.sh [deleted file]
scripts/rev_control/svnapply.sh
scripts/rev_control/version_control.sh
scripts/security/fix_ssh_perms.sh [new file with mode: 0644]

index 0d78316920e5c40b112cdea2edbf243091fe1b1b..c7d9c507622dfadb23847c853adbb32ea17557eb 100644 (file)
@@ -4,5 +4,5 @@
 # repositories, such as sourceforge or github.  the uploading process (which we think of as sending
 # those updated items swimming downstream to their dependent repositories) is done automatically in
 # our makefiles.  that's why the code below relies on the top-level makefile in home.
-14 3 * * * (source $FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh; cd $HOME ; bash $FEISTY_MEOW_SCRIPTS/rev_control/rev_update.sh ; make ) &>>/tmp/${CRONUSER}-cron-synch_and_swim_downstream.log
+14 3 * * * (source $FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh; cd $HOME ; bash $FEISTY_MEOW_SCRIPTS/rev_control/rgetem.sh ; make ) &>>/tmp/${CRONUSER}-cron-synch_and_swim_downstream.log
 
index 13518e95e5826ecdd44a41faef87a95688252f53..77c2c939018034e456d363cbb71f21837c17aa41 100644 (file)
@@ -17,7 +17,7 @@ function update_source_folders()
     echo Changing to the folder $folder failed.
     exit 1
   fi
-  bash "$FEISTY_MEOW_SCRIPTS/rev_control/rev_checkin.sh"
+  bash "$FEISTY_MEOW_SCRIPTS/rev_control/rcheckin.sh"
   if [ $? -ne 0 ]; then
     echo Checking out the latest codes has failed somehow for $folder.
     exit 1
index 6572a48656192f469236c298ed7b145335247dad..6f02ae26160a62b4f6abc0b7d31104a8a7195993 100644 (file)
@@ -347,7 +347,7 @@ if [ -z "$skip_all" ]; then
 #    fi
   }
   
-  # trashes the .#blah files that cvs and svn leave behind when finding conflicts.
+  # trashes the .#blah files that cvs and subversion leave behind when finding conflicts.
   # this kind of assumes you've already checked them for any salient facts.
   function clean_cvs_junk() {
     for i in $*; do
diff --git a/scripts/files/cleanerator.sh b/scripts/files/cleanerator.sh
deleted file mode 100644 (file)
index 1d1e138..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/bin/bash
-
-cleaning_dirs=($*)
-
-more_authoritative=( ~/feisty_meow ~/scavenging_inova/inovasoft )
-###not yet ~/scavenging_inova/lightlink 
-
-if [ -z "$TMP" ]; then TMP=/tmp; fi
-
-# we generate the full directory list for the authoritative places into here.
-zesty_authoritative_dirs=$(mktemp $TMP/cleanerator_authority.XXXXXX)
-# we also make a list of all the directories under our cleaning locations here.
-perky_scrubbing_dirs=$(mktemp $TMP/cleanerator_scrubbinz.XXXXXX)
-
-# dump out the directories found in the authoritative areas.
-for i in "${more_authoritative[@]}"; do
-  real_dir="$(\cd "$i" && \pwd)"
-  find "$real_dir" -type d | grep -v "\.svn" | grep -v "\.git" >>"$zesty_authoritative_dirs"
-done
-
-# now go to all of our places to clean, find all directories under them,
-# and add them to our big list of places to scrub.
-for i in "${cleaning_dirs[@]}"; do
-  real_dir="$(\cd "$i" && \pwd)"
-  find "$real_dir" -depth -type d | grep -v "\.svn" | grep -v "\.git" >>"$perky_scrubbing_dirs"
-done
-
-# load all the names from our files and do a massive N x M size loop.
-while read i; do
-#  echo "cleaning: $i"
-  pushd "$i" &>/dev/null
-#pwd
-  while read j; do 
-#    echo "against authority: $j"
-    # try to clean it out of source control first.
-    bash ~/feisty_meow/scripts/rev_control/svn_rm_dupes.sh "$j" "$i"
-    # if that doesn't work, just whack it.
-    bash ~/feisty_meow/scripts/files/whack_dupes.sh "$j" "$i"
-  done <"$zesty_authoritative_dirs"
-  popd &>/dev/null
-done <"$perky_scrubbing_dirs"
-
-# clean up afterwards.
-rm -f "$zesty_authoritative_dirs"
-rm -f "$perky_scrubbing_dirs"
-
diff --git a/scripts/rev_control/diff_repo.sh b/scripts/rev_control/diff_repo.sh
new file mode 100644 (file)
index 0000000..d74905c
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/bash
+# does differences on a set of folders checked out from subversion or git.
+# this can take a directory as parameter, but will default to the current
+# working directory.  all the directories under the passed directory will
+# be examined.
+
+dir="$1"; shift
+if [ -z "$dir" ]; then
+  dir=.
+fi
+
+source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
+source "$FEISTY_MEOW_SCRIPTS/rev_control/version_control.sh"
+
+pushd "$dir" &>/dev/null
+tempfile=$(generate_rev_ctrl_filelist)
+popd &>/dev/null
+
+perform_revctrl_action_on_file "$tempfile" do_diff
+
diff --git a/scripts/rev_control/fix_ssh_perms.sh b/scripts/rev_control/fix_ssh_perms.sh
deleted file mode 100644 (file)
index eb294fc..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/bash
-
-# resets the permissions on the .ssh directory to be safe.
-# otherwise ssh may ignore keys and such from there.
-
-chmod 700 $HOME/.ssh 
-chmod 600 $HOME/.ssh/*
-
-
diff --git a/scripts/rev_control/fix_svn_item.sh b/scripts/rev_control/fix_svn_item.sh
deleted file mode 100644 (file)
index 941e572..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-
-# resolves a tree conflict by accepting the "working" version,
-# which effectively makes your current change the accepted one.
-
-filename="$1"; shift
-
-svn resolve --accept=working "$filename"
-
-
diff --git a/scripts/rev_control/rcheckin.sh b/scripts/rev_control/rcheckin.sh
new file mode 100644 (file)
index 0000000..cfb72c2
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/bash
+# checks in the updated files in a set of folders checked out from subversion
+# or git.  this can take a directory as parameter, but will default to the
+# current working directory.  all the directories under the passed directory
+# will be examined.
+
+dir="$1"; shift
+if [ -z "$dir" ]; then
+  dir=.
+fi
+
+source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
+source "$FEISTY_MEOW_SCRIPTS/rev_control/version_control.sh"
+
+pushd "$dir" &>/dev/null
+tempfile=$(generate_rev_ctrl_filelist)
+popd &>/dev/null
+
+perform_revctrl_action_on_file "$tempfile" do_checkin
+
diff --git a/scripts/rev_control/report_new.sh b/scripts/rev_control/report_new.sh
new file mode 100644 (file)
index 0000000..224b1df
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/bash
+# this script reports files that are not checked in yet in a set of folders.
+# it works with subversion only, since git handles new files well whereas
+# subversion ignores them until you tell it about them.  this script can take
+# a directory as a parameter, but will default to the current directory.
+# all the directories under the passed directory will be examined.
+
+dir="$1"; shift
+if [ -z "$dir" ]; then
+  dir=.
+fi
+
+source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
+source "$FEISTY_MEOW_SCRIPTS/rev_control/version_control.sh"
+
+pushd "$dir" &>/dev/null
+tempfile=$(generate_rev_ctrl_filelist)
+popd &>/dev/null
+
+perform_revctrl_action_on_file "$tempfile" do_report_new
+
diff --git a/scripts/rev_control/resolve_svn.sh b/scripts/rev_control/resolve_svn.sh
new file mode 100644 (file)
index 0000000..941e572
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+# resolves a tree conflict by accepting the "working" version,
+# which effectively makes your current change the accepted one.
+
+filename="$1"; shift
+
+svn resolve --accept=working "$filename"
+
+
diff --git a/scripts/rev_control/rev_checkin.sh b/scripts/rev_control/rev_checkin.sh
deleted file mode 100644 (file)
index cfb72c2..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-# checks in the updated files in a set of folders checked out from subversion
-# or git.  this can take a directory as parameter, but will default to the
-# current working directory.  all the directories under the passed directory
-# will be examined.
-
-dir="$1"; shift
-if [ -z "$dir" ]; then
-  dir=.
-fi
-
-source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
-source "$FEISTY_MEOW_SCRIPTS/rev_control/version_control.sh"
-
-pushd "$dir" &>/dev/null
-tempfile=$(generate_rev_ctrl_filelist)
-popd &>/dev/null
-
-perform_revctrl_action_on_file "$tempfile" do_checkin
-
diff --git a/scripts/rev_control/rev_diff.sh b/scripts/rev_control/rev_diff.sh
deleted file mode 100644 (file)
index d74905c..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-# does differences on a set of folders checked out from subversion or git.
-# this can take a directory as parameter, but will default to the current
-# working directory.  all the directories under the passed directory will
-# be examined.
-
-dir="$1"; shift
-if [ -z "$dir" ]; then
-  dir=.
-fi
-
-source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
-source "$FEISTY_MEOW_SCRIPTS/rev_control/version_control.sh"
-
-pushd "$dir" &>/dev/null
-tempfile=$(generate_rev_ctrl_filelist)
-popd &>/dev/null
-
-perform_revctrl_action_on_file "$tempfile" do_diff
-
diff --git a/scripts/rev_control/rev_report_new.sh b/scripts/rev_control/rev_report_new.sh
deleted file mode 100644 (file)
index 224b1df..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-# this script reports files that are not checked in yet in a set of folders.
-# it works with subversion only, since git handles new files well whereas
-# subversion ignores them until you tell it about them.  this script can take
-# a directory as a parameter, but will default to the current directory.
-# all the directories under the passed directory will be examined.
-
-dir="$1"; shift
-if [ -z "$dir" ]; then
-  dir=.
-fi
-
-source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
-source "$FEISTY_MEOW_SCRIPTS/rev_control/version_control.sh"
-
-pushd "$dir" &>/dev/null
-tempfile=$(generate_rev_ctrl_filelist)
-popd &>/dev/null
-
-perform_revctrl_action_on_file "$tempfile" do_report_new
-
diff --git a/scripts/rev_control/rev_update.sh b/scripts/rev_control/rev_update.sh
deleted file mode 100644 (file)
index 6e09627..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-# a simple script for updating a set of folders from subversion or git.
-# this can take a directory as parameter, but will default to the current
-# working directory.  all the directories under the passed directory will
-# be examined.
-
-dir="$1"; shift
-if [ -z "$dir" ]; then
-  dir=.
-fi
-
-source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
-source "$FEISTY_MEOW_SCRIPTS/rev_control/version_control.sh"
-
-pushd "$dir" &>/dev/null
-tempfile=$(generate_rev_ctrl_filelist)
-popd &>/dev/null
-
-perform_revctrl_action_on_file "$tempfile" do_update
-
diff --git a/scripts/rev_control/rgetem.sh b/scripts/rev_control/rgetem.sh
new file mode 100644 (file)
index 0000000..6e09627
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/bash
+# a simple script for updating a set of folders from subversion or git.
+# this can take a directory as parameter, but will default to the current
+# working directory.  all the directories under the passed directory will
+# be examined.
+
+dir="$1"; shift
+if [ -z "$dir" ]; then
+  dir=.
+fi
+
+source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
+source "$FEISTY_MEOW_SCRIPTS/rev_control/version_control.sh"
+
+pushd "$dir" &>/dev/null
+tempfile=$(generate_rev_ctrl_filelist)
+popd &>/dev/null
+
+perform_revctrl_action_on_file "$tempfile" do_update
+
diff --git a/scripts/rev_control/svn.sh b/scripts/rev_control/svn.sh
deleted file mode 100644 (file)
index 63af669..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-
-if [ "$OPERATING_SYSTEM" = "WIN32" ]; then
-  source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
-
-  TMP="$(dos_to_unix_path "$TMP")"
-fi
-
-#echo TMP is $TMP 
-
-/usr/bin/svn $@
-
index c9db62e71cce74b3756b570637faa8279d42cd88..32ce85aa2375cd8e4b7565264cb64b64b0512db8 100644 (file)
@@ -1,12 +1,15 @@
 #!/bin/bash
 #
-# Applies arbitrary commands to any svn status. e.g.
+# Applies arbitrary commands to any svn status.
 #
-# Delete all non-svn files (escape the ? from the shell):
-# svnapply \? rm
+# For example, this shows any files that are in the working folder but are not part of the svn repository:
+#    svnapply \? echo
+#
+# This deletes all files that are not checked into svn (escape the ? from the shell):
+#    svnapply \? rm
 #
 # List all conflicted files:
-# svnapply C ls -l
+#    svnapply C ls -l
 #
 # found on web at:
 # http://stackoverflow.com/questions/160104/how-do-you-add-all-untracked-files-in-svn-something-like-git-add-i
index 4a8a542da87620c85e47b49a7d341fce91764e57..b28d6f303b7e69fc1edb7daa971e3ecfa8f2c3e7 100644 (file)
@@ -307,13 +307,13 @@ function generate_rev_ctrl_filelist()
   local dir="$1"; shift
   pushd "$dir" &>/dev/null
   local dirhere="$( \cd "$(\dirname "$dir")" && /bin/pwd )"
-  local tempfile=$(mktemp /tmp/zz_rev_checkin.XXXXXX)
+  local tempfile=$(mktemp /tmp/zz_checkins.XXXXXX)
   echo >$tempfile
   find $dirhere -follow -maxdepth $MAX_DEPTH -type d -iname ".svn" -exec echo {}/.. ';' >>$tempfile 2>/dev/null
   find $dirhere -follow -maxdepth $MAX_DEPTH -type d -iname ".git" -exec echo {}/.. ';' >>$tempfile 2>/dev/null
   # CVS is not well behaved like git and (now) svn, and we seldom use it anymore.
   popd &>/dev/null
-  local sortfile=$(mktemp /tmp/zz_rev_checkin_sort.XXXXXX)
+  local sortfile=$(mktemp /tmp/zz_checkin_sort.XXXXXX)
   sort <"$tempfile" >"$sortfile"
   \rm "$tempfile"
   echo "$sortfile"
diff --git a/scripts/security/fix_ssh_perms.sh b/scripts/security/fix_ssh_perms.sh
new file mode 100644 (file)
index 0000000..eb294fc
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+# resets the permissions on the .ssh directory to be safe.
+# otherwise ssh may ignore keys and such from there.
+
+chmod 700 $HOME/.ssh 
+chmod 600 $HOME/.ssh/*
+
+