From ba3dab0632f2eedfce6f724d76a9c967ccb9fe90 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Fri, 3 Nov 2017 01:19:14 -0400 Subject: [PATCH] cleaning up revision control tools 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. --- .../cron/synch_and_swim_downstream.crontab | 2 +- scripts/archival/shared_updater_parts.sh | 2 +- scripts/core/functions.sh | 2 +- scripts/files/cleanerator.sh | 46 ------------------- .../rev_control/{rev_diff.sh => diff_repo.sh} | 0 .../{rev_checkin.sh => rcheckin.sh} | 0 .../{rev_report_new.sh => report_new.sh} | 0 .../{fix_svn_item.sh => resolve_svn.sh} | 0 .../rev_control/{rev_update.sh => rgetem.sh} | 0 scripts/rev_control/svn.sh | 12 ----- scripts/rev_control/svnapply.sh | 11 +++-- scripts/rev_control/version_control.sh | 4 +- .../fix_ssh_perms.sh | 0 13 files changed, 12 insertions(+), 67 deletions(-) delete mode 100644 scripts/files/cleanerator.sh rename scripts/rev_control/{rev_diff.sh => diff_repo.sh} (100%) rename scripts/rev_control/{rev_checkin.sh => rcheckin.sh} (100%) rename scripts/rev_control/{rev_report_new.sh => report_new.sh} (100%) rename scripts/rev_control/{fix_svn_item.sh => resolve_svn.sh} (100%) rename scripts/rev_control/{rev_update.sh => rgetem.sh} (100%) delete mode 100644 scripts/rev_control/svn.sh rename scripts/{rev_control => security}/fix_ssh_perms.sh (100%) diff --git a/infobase/configuration/cron/synch_and_swim_downstream.crontab b/infobase/configuration/cron/synch_and_swim_downstream.crontab index 0d783169..c7d9c507 100644 --- a/infobase/configuration/cron/synch_and_swim_downstream.crontab +++ b/infobase/configuration/cron/synch_and_swim_downstream.crontab @@ -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 diff --git a/scripts/archival/shared_updater_parts.sh b/scripts/archival/shared_updater_parts.sh index 13518e95..77c2c939 100644 --- a/scripts/archival/shared_updater_parts.sh +++ b/scripts/archival/shared_updater_parts.sh @@ -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 diff --git a/scripts/core/functions.sh b/scripts/core/functions.sh index 6572a486..6f02ae26 100644 --- a/scripts/core/functions.sh +++ b/scripts/core/functions.sh @@ -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 index 1d1e138c..00000000 --- a/scripts/files/cleanerator.sh +++ /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/rev_diff.sh b/scripts/rev_control/diff_repo.sh similarity index 100% rename from scripts/rev_control/rev_diff.sh rename to scripts/rev_control/diff_repo.sh diff --git a/scripts/rev_control/rev_checkin.sh b/scripts/rev_control/rcheckin.sh similarity index 100% rename from scripts/rev_control/rev_checkin.sh rename to scripts/rev_control/rcheckin.sh diff --git a/scripts/rev_control/rev_report_new.sh b/scripts/rev_control/report_new.sh similarity index 100% rename from scripts/rev_control/rev_report_new.sh rename to scripts/rev_control/report_new.sh diff --git a/scripts/rev_control/fix_svn_item.sh b/scripts/rev_control/resolve_svn.sh similarity index 100% rename from scripts/rev_control/fix_svn_item.sh rename to scripts/rev_control/resolve_svn.sh diff --git a/scripts/rev_control/rev_update.sh b/scripts/rev_control/rgetem.sh similarity index 100% rename from scripts/rev_control/rev_update.sh rename to scripts/rev_control/rgetem.sh diff --git a/scripts/rev_control/svn.sh b/scripts/rev_control/svn.sh deleted file mode 100644 index 63af6695..00000000 --- a/scripts/rev_control/svn.sh +++ /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 $@ - diff --git a/scripts/rev_control/svnapply.sh b/scripts/rev_control/svnapply.sh index c9db62e7..32ce85aa 100644 --- a/scripts/rev_control/svnapply.sh +++ b/scripts/rev_control/svnapply.sh @@ -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 diff --git a/scripts/rev_control/version_control.sh b/scripts/rev_control/version_control.sh index 4a8a542d..b28d6f30 100644 --- a/scripts/rev_control/version_control.sh +++ b/scripts/rev_control/version_control.sh @@ -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/rev_control/fix_ssh_perms.sh b/scripts/security/fix_ssh_perms.sh similarity index 100% rename from scripts/rev_control/fix_ssh_perms.sh rename to scripts/security/fix_ssh_perms.sh -- 2.34.1