From c535e51109ee8fffd00128d8037e8de36ef12fb7 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Sun, 12 Feb 2012 13:42:39 -0500 Subject: [PATCH] tossing a few older svn and cvs scripts out. the need to tag bunches of files as executables has not arisen in a long time for me in svn, and i would use a handy tool like kdesvn these days rather than a script. the cvs importer allowed one to drag in vast batches of files into a cvs archive, but i've retired most uses of cvs from my life, so... and then there are a few little improvements for checking in and out files with checkin and getme. --- scripts/rev_control/checkin.sh | 5 +- scripts/rev_control/cvs_importer.sh | 81 ------------------------- scripts/rev_control/fix_svn_binaries.sh | 22 ------- scripts/rev_control/getme.sh | 19 ++++-- scripts/rev_control/svn_set_binary.sh | 9 --- 5 files changed, 16 insertions(+), 120 deletions(-) delete mode 100644 scripts/rev_control/cvs_importer.sh delete mode 100644 scripts/rev_control/fix_svn_binaries.sh delete mode 100644 scripts/rev_control/svn_set_binary.sh diff --git a/scripts/rev_control/checkin.sh b/scripts/rev_control/checkin.sh index a730031f..c2ff14a2 100644 --- a/scripts/rev_control/checkin.sh +++ b/scripts/rev_control/checkin.sh @@ -1,7 +1,6 @@ #!/bin/bash -# checks in all our commonly used folders. -# note: fred specific. +# checks in all the folders present in the REPOSITORY_LIST variable. source "$FEISTY_MEOW_SCRIPTS/rev_control/rev_control.sh" @@ -29,13 +28,11 @@ function do_checkin() function checkin_list { local list=$* for i in $list; do -echo whole list is ${REPOSITORY_LIST} # turn repo list back into an array. eval "repository_list=( ${REPOSITORY_LIST[*]} )" for j in "${repository_list[@]}"; do # add in the directory component. j="$i/$j" -echo here the dir thing is: $j if [ ! -d "$j" ]; then continue; fi pushd $j &>/dev/null diff --git a/scripts/rev_control/cvs_importer.sh b/scripts/rev_control/cvs_importer.sh deleted file mode 100644 index 7aa1b28f..00000000 --- a/scripts/rev_control/cvs_importer.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/bash -# cvs_importer: this tool does a recursive cvs add. it takes one or more -# directory names and recursively adds them to the cvs hierarchy they are -# currently located under (i.e., their parent directory). - -if [ "$#" = "0" ]; then - echo "This program needs one or more directory names to recursively add." - exit 23 -fi - -function add_cvs_dir { - # loop across all the directories we were handed. these had better be - # arranged in hierarchically descending order or cvs will not like adding - # them. - for q in $*; do - if [ "$(basename $q)" == "CVS" ]; then -#echo "the parameter was cvs! -> $q" - continue; - fi - cvs add "$q" -#echo "just added directory $q" - done -} - -function add_cvs_files { - # scans through the list of directories we were given. each directory is - # assumed to have some files which need to be added. we will add those - # files to cvs on a per directory basis to avoid clogging up the command - # lines and such. - for q in $*; do - if [ "$(basename $q)" == "CVS" ]; then -#echo "skipping parameter as cvs! -> $q" - continue; - fi - - pushd $q &>/dev/null - if [ $? -ne 0 ]; then - echo "Skipping badly erroneous directory $i. Logic error?" - continue; - fi - - # add all the files in this directory, but don't do subdirectories. - file_list=$(find . -maxdepth 1 -type f) - # make sure there are actually some files there. - if [ ! -z "$file_list" ]; then - find . -maxdepth 1 -type f -exec cvs add "{}" '+' -#echo "just added those files to $q directory" - fi - - # go back to where we were before jumping into the directory. - popd &>/dev/null - done -} - -# main activity of script occurs starting here... - -# loop across the directory names we were given on the command line. -for i in $*; do - # change into the directory just above the directory to add. - parent_dir=$(dirname $i) - adding_dir=$(basename $i) - pushd $parent_dir &>/dev/null - if [ $? -ne 0 ]; then - echo "Skipping erroneous parent directory $parent_dir." - continue; - fi -#echo dir is now: $(pwd) - - # find all the directories starting at the real directory to add, and add - # cvs repositories for each of them. - add_cvs_dir $(find $adding_dir -type d) - - # now add all the files, since all of the directories should be listed - # in the cvs archive. - add_cvs_files $(find $adding_dir -type d) - - # go back to the directory where we were previously. - popd &>/dev/null - -done - diff --git a/scripts/rev_control/fix_svn_binaries.sh b/scripts/rev_control/fix_svn_binaries.sh deleted file mode 100644 index 0d29c81e..00000000 --- a/scripts/rev_control/fix_svn_binaries.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# this script spiders across the first argument and locates any files that -# should be set up as binaries. it removes the most likely wrong tags that -# these files have after conversion from cvs (using cvs2svn). -# we remove the executable bit because there are really very few files where -# we want this enabled in the source tree. -for i in `find $1 -type f -iname "*.a" \ - -o -iname "*.ansi" -o -iname "*.bat" -o -iname "*.bmp" \ - -o -iname "*.cur" -o -iname "*.dbc" -o -iname "*.dbf" \ - -o -iname "*.doc" -o -iname "*.dll" -o -iname "*.exe" \ - -o -iname "*.exp" -o -iname "*.gif" \ - -o -iname "*.gnucash" -o -iname "*.ico" -o -iname "*.jar" \ - -o -iname "*.jpg" -o -iname "*.lib" -o -iname "*.manifest" \ - -o -iname "*.mp3" \ - -o -iname "*.msi" -o -iname "*.ocx" -o -iname "*.pdf" \ - -o -iname "*.pm5" -o -iname "*.png" -o -iname "*.rtf" \ - -o -iname "*.wav" -o -iname "*.wri" -o -iname "*.vsd" \ - -o -iname "*.xcf" -o -iname "*.xls" -o -iname "*.zip" \ - `; do - bash $SHELLDIR/svn_set_binary.sh "$i" -done - diff --git a/scripts/rev_control/getme.sh b/scripts/rev_control/getme.sh index 58da7087..15e986ef 100644 --- a/scripts/rev_control/getme.sh +++ b/scripts/rev_control/getme.sh @@ -1,11 +1,15 @@ #!/bin/bash -# gets all of fred's revision control folders out. +# gets any updates for the repository folders present in the REPOSITORY_LIST variable. source "$FEISTY_MEOW_SCRIPTS/rev_control/rev_control.sh" +# trickery to ensure we can always update this file, even when the operating system has some +# rude behavior with regard to file locking (ahem, windows...). if [ "$(pwd)" != "$TMP" ]; then -# echo "Moving to the TMP directory to avoid file access conflicts..." + if [ ! -z "$SHELL_DEBUG" ]; then + echo "Moving to the TMP directory to avoid file access conflicts..." + fi new_name="$TMP/zz_$(basename $0)" cp -f "$0" "$new_name" if [ $? -ne 0 ]; then @@ -17,8 +21,6 @@ if [ "$(pwd)" != "$TMP" ]; then exec "$new_name" fi -export TMPO_CHK=$TMP/zz_chk.log - # selects the checkout method based on where we are (the host the script runs on). function do_update() { @@ -35,6 +37,7 @@ function do_update() fi } +# gets all the updates for a list of folders under revision control. function checkout_list { list=$* for i in $list; do @@ -56,6 +59,10 @@ function checkout_list { done } +############## + +export TMPO_CHK=$TMP/zz_chk.log + rm -f "$TMPO_CHK" # perform the checkouts as appropriate per OS. @@ -67,9 +74,13 @@ fi less $TMPO_CHK +############## + # we now regenerate the scripts after getme, to ensure it's done automatically. bash "$FEISTY_MEOW_SCRIPTS/core/bootstrap_shells.sh" perl "$FEISTY_MEOW_SCRIPTS/core/generate_aliases.pl" echo nechung +############## + diff --git a/scripts/rev_control/svn_set_binary.sh b/scripts/rev_control/svn_set_binary.sh deleted file mode 100644 index 353fb041..00000000 --- a/scripts/rev_control/svn_set_binary.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -# clean out flags that hinder files being binary. -for i in $*; do - echo "svn binary -> $i" - svn pd svn:executable "$i" >/dev/null 2>&1 - svn pd svn:eol-style "$i" >/dev/null 2>&1 - svn pd svn:keywords "$i" >/dev/null 2>&1 -done - -- 2.34.1