From: Frank Brehm Date: Fri, 10 Dec 2010 23:43:02 +0000 (+0000) Subject: sauberer gemacht X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=020db16fb03352fd704027a163c07a5792b4225a;p=scripts%2Fsolaris.git sauberer gemacht --- diff --git a/checkin b/checkin index 498046d..ad8aff8 100755 --- a/checkin +++ b/checkin @@ -52,6 +52,14 @@ for FILE in "$@"; do continue fi + if [ -d "${FILE}" ] ; then + if [ -n "${VERBOSE}" ] ; then + echo + fi + echo "'${FILE}' is a directory - later ...." >&2 + continue + fi + if [ ! -f "${FILE}" ] ; then if [ -n "${VERBOSE}" ] ; then echo @@ -75,7 +83,6 @@ for FILE in "$@"; do CURDIR=$( dirname "${FILE}" ) RCS_DIR="${CURDIR}"/.rcs - FILE_COPY="${RCS_DIR}"/"$( basename "${FILE}" )" RCS_FILE="${RCS_DIR}"/"$( basename "${FILE}" ),v" RCS_FILE_OLD="${FILE}",v @@ -103,12 +110,6 @@ for FILE in "$@"; do fi fi - if [ -n "${VERBOSE}" ] ; then - cp -pv "${FILE}" "${FILE_COPY}" - else - cp -p "${FILE}" "${FILE_COPY}" - fi - USE_MSG="Initial" if [ -f "${RCS_FILE}" ] ; then USE_MSG="Checked in." @@ -120,29 +121,24 @@ for FILE in "$@"; do IS_NEW= if [ -f "${RCS_FILE}" ] ; then if [ -n "${VERBOSE}" ] ; then - echo "rcsdiff \"${FILE_COPY}\"" - rcsdiff -q "${FILE_COPY}" >/dev/null + echo "rcsdiff \"${FILE}\" \"${RCS_FILE}\"" + rcsdiff -q "${FILE}" "${RCS_FILE}" >/dev/null RES="$?" else - rcsdiff -q "${FILE_COPY}" >/dev/null + rcsdiff -q "${FILE}" "${RCS_FILE}" >/dev/null RES="$?" fi if [ "${RES}" = "0" ] ; then - REVISION=$( rlog -h "${FILE_COPY}" | grep '^head:' | awk '{ print $2}' ) + REVISION=$( rlog -h "${FILE}" "${RCS_FILE}" | grep '^head:' | awk '{ print $2}' ) echo "File '${FILE}' wasn't changed, Revision ${REVISION}." >&2 - if [ -n "${VERBOSE}" ] ; then - rm -v "${FILE_COPY}" - else - rm "${FILE_COPY}" - fi continue fi else if [ -n "${VERBOSE}" ] ; then echo "Creating new '${RCS_FILE}' ..." - echo "Initialising repository" | rcs -i "${FILE_COPY}" + echo "Initialising repository" | rcs -i "${FILE}" "${RCS_FILE}" else - echo "Initialising repository" | rcs -i -q "${FILE_COPY}" + echo "Initialising repository" | rcs -i -q "${FILE}" "${RCS_FILE}" fi IS_NEW=y fi @@ -155,39 +151,35 @@ for FILE in "$@"; do PERM=$( stat -c "%a" "${FILE}" ) if [ -z "${IS_NEW}" ] ; then if [ -n "${VERBOSE}" ] ; then - echo " rcs -l \"${FILE_COPY}\"" - rcs -l "${FILE_COPY}" + echo " rcs -l \"${FILE}\" \"${RCS_FILE}\"" + rcs -l "${FILE}" "${RCS_FILE}" else - rcs -q -l "${FILE_COPY}" >/dev/null + rcs -q -l "${FILE}" "${RCS_FILE}" >/dev/null fi fi if [ -n "${VERBOSE}" ] ; then - echo " echo \"${USE_MSG}\" | ci -u -d \"${FILE_COPY}\"" - echo "${USE_MSG}" | ci -u -d "${FILE_COPY}" + echo " echo \"${USE_MSG}\" | ci -u -d \"${FILE}\" \"${RCS_FILE}\"" + echo "${USE_MSG}" | ci -u -d "${FILE}" "${RCS_FILE}" else - echo "${USE_MSG}" | ci -u -d -q "${FILE_COPY}" + echo "${USE_MSG}" | ci -u -d -q "${FILE}" "${RCS_FILE}" fi if [ -n "${VERBOSE}" ] ; then - echo " rcs -u \"${FILE_COPY}\"" - rcs -u "${FILE_COPY}" + echo " rcs -u \"${FILE}\" \"${RCS_FILE}\"" + rcs -u "${FILE}" "${RCS_FILE}" else - rcs -q -u "${FILE_COPY}" >/dev/null + rcs -q -u "${FILE}" "${RCS_FILE}" >/dev/null fi if [ -n "${VERBOSE}" ] ; then - echo " chmod ${PERM} \"${FILE_COPY}\"" - chmod -v "${PERM}" "${FILE_COPY}" - cp -pv "${FILE_COPY}" "${FILE}" - rm -v -f "${FILE_COPY}" + echo " chmod ${PERM} \"${FILE}\"" + chmod -v "${PERM}" "${FILE}" else - chmod "${PERM}" "${FILE_COPY}" - cp -p "${FILE_COPY}" "${FILE}" - rm -f "${FILE_COPY}" + chmod "${PERM}" "${FILE}" fi - REVISION=$( rlog -h "${FILE_COPY}" | grep '^head:' | awk '{ print $2}' ) + REVISION=$( rlog -h "${FILE}" "${RCS_FILE}" | grep '^head:' | awk '{ print $2}' ) echo "New Revision: '${REVISION}'" done