From: Frank Brehm Date: Sat, 11 Dec 2010 07:11:30 +0000 (+0000) Subject: checkin rehursiv gemacht X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=2275e45a45c4a3a2a0b9a40b3a6e28846ac5f08d;p=scripts%2Fsolaris.git checkin rehursiv gemacht --- diff --git a/checkin b/checkin index ad8aff8..46b3bd7 100755 --- a/checkin +++ b/checkin @@ -42,6 +42,55 @@ shift $((OPTIND-1)) #echo "Noch vorhandene Parameter: $@" #echo "Zu nehmende Botschaft: '${MSG}'" +checkin_dir_recursive() { + + DIR="$1" + DELIM=" +" + OIFS="${IFS}" + + if [ -n "${VERBOSE}" ] ; then + echo + echo "Checking in directory '${DIR}' recursive ..." + fi + + ARGS=( ) + if [ -n "${VERBOSE}" ] ; then + ARGS=( "${ARGS[@]}" "-v" ) + fi + if [ -n "${ALLWAYS_YES}" ] ; then + ARGS=( "${ARGS[@]}" "-y" ) + fi + if [ -n "${MSG}" ] ; then + ARGS=( "${ARGS[@]}" "-m" ) + ARGS=( "${ARGS[@]}" "${MSG}" ) + fi + + list=() + IFS="${DELIM}" + for item in $( ls -A1d "${DIR}"/* "${DIR}"/.[^.]* 2>/dev/null ); do + #echo "item: '${item}'" + dont_checkin= + BASENAME="$( basename ${item} )" + for name in ".rcs" "RCS" ".svn" ".git" ; do + if [ "${BASENAME}" == "${name}" ] ; then + dont_checkin=y + break + fi + done + if [ "${dont_checkin}" == "y" ] ; then + continue + fi + if [ -e "${item}" ] ; then + list=( "${list[@]}" "${item}" ) + fi + done + IFS="${OIFS}" + #echo "${list[@]}" + $0 "${ARGS[@]}" "${list[@]}" + +} + for FILE in "$@"; do if [ ! -e "${FILE}" ] ; then @@ -56,7 +105,7 @@ for FILE in "$@"; do if [ -n "${VERBOSE}" ] ; then echo fi - echo "'${FILE}' is a directory - later ...." >&2 + checkin_dir_recursive "${FILE}" continue fi