반응형
Warning : COMMIT_FILENAME_NO_TRUNK !!!!!!!!!!!!!!!!!
=====================================================
if [ $# != 2 ]; then
echo "Usage: $0 <Repository> <Revision>"
exit 1
fi
REPOS="$1"
REV="$2"
WEB_DIR="/home/lod/"
GUID="lod:lod"
RESULT_TMP=$(svnlook changed -r ${REV} ${REPOS} | awk '{print $1$2}')
echo $RESULT_TMP >> /tmp/tmp_file
if [ -z $RESULT_TMP ]; then
exit 1
fi
for RESULT in $RESULT_TMP
do
COMMIT_STATUS=$(echo ${RESULT:0:1})
if [ -z $COMMIT_STATUS ]; then
exit 1+
fi
case "$COMMIT_STATUS" in
[UA])
COMMIT_FILENAME=$(echo ${RESULT:1})
PATH_FILTER=$(echo "$RESULT"|awk -F / '{for (i=2;i<NF;i=i+1){ print "/"$i } }')
PATH_FILTER2=$(echo $PATH_FILTER|sed 's/ //g')
#COMMIT_FILENAME=$WEB_DIR$PATH_FILTER2
COMMIT_FILENAME_NO_TRUNK=$(echo ${RESULT:12})
EXPORT_RESULT=$(svn export --force -r ${REV} "file://${REPOS}/${COMMIT_FILENAME}" "${WEB_DIR}${COMMIT_FILENAME_NO_TRUNK}")
#chown "$GUID" -R "${WEB_DIR}${COMMIT_FILENAME_NO_TRUNK}"
chown "$GUID" "${WEB_DIR}${COMMIT_FILENAME_NO_TRUNK}"
;;
[DRG])
#rm -rf ${WEB_DIR}${COMMIT_FILENAME}
echo "${COMMIT_STATUS}" "${COMMIT_FILENAME}" >> "${REPOS}"/delete_release_changed_commit_log;;
"C")
#exit 1;;
echo "${COMMIT_STATUS}" "${COMMIT_FILENAME}" >> "${REPOS}"/delete_release_changed_commit_log;;
*)
;;
esac
EXPORT_RESULT_FILE=$(echo $EXPORT_RESULT | awk '{print $2}')
EXPORT_RESULT_MSG=$(echo $EXPORT_RESULT | awk '{print $3$4}')
# Check exporting status
#if [$EXPORT_RESULT_MSG != "Exportcomplete." ]; then
# exit 1
#fi
done
exit 0
반응형