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
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
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."
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
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