| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function texinfo_copyEntry { |
| |
| |
| |
| if [[ $# -lt 2 ]];then |
| cli_printMessage "`gettext "Two paths are required."`" --as-error-line |
| elif [[ $# -gt 2 ]];then |
| cli_printMessage "`gettext "Only two paths are supported."`" --as-error-line |
| fi |
| |
| |
| cli_printMessage '-' --as-separator-line |
| |
| |
| |
| local MANUAL_ENTRY_SRC=$(${MANUAL_BACKEND}_getEntry "${1}") |
| |
| |
| |
| local MANUAL_ENTRY_DST=$(${MANUAL_BACKEND}_getEntry "${2}") |
| |
| |
| |
| if [[ ! -d $(dirname ${MANUAL_ENTRY_DST}) ]];then |
| mkdir -p $(dirname ${MANUAL_ENTRY_DST}) |
| svn add $(dirname ${MANUAL_ENTRY_DST}) --quiet |
| fi |
| |
| |
| if [[ -f ${MANUAL_ENTRY_SRC} ]];then |
| if [[ ! -f ${MANUAL_ENTRY_DST} ]];then |
| cli_printMessage "${MANUAL_ENTRY_DST}" --as-creating-line |
| svn cp "${MANUAL_ENTRY_SRC}" "${MANUAL_ENTRY_DST}" --quiet |
| else |
| cli_printMessage "`gettext "The target location is not valid."`" --as-error-line |
| fi |
| else |
| cli_printMessage "`gettext "The source location is not valid."`" --as-error-line |
| fi |
| |
| |
| |
| MANUAL_ENTRY_SRC=$(echo ${MANUAL_ENTRY_SRC} | sed -r "s/\.${MANUAL_EXTENSION}$//") |
| MANUAL_ENTRY_DST=$(echo ${MANUAL_ENTRY_DST} | sed -r "s/\.${MANUAL_EXTENSION}$//") |
| |
| |
| if [[ -d ${MANUAL_ENTRY_SRC} ]];then |
| if [[ ! -a ${MANUAL_ENTRY_DST} ]];then |
| cli_printMessage "${MANUAL_ENTRY_DST}" --as-creating-line |
| svn cp "${MANUAL_ENTRY_SRC}" "${MANUAL_ENTRY_DST}" --quiet |
| fi |
| fi |
| |
| |
| local MANUAL_ENTRY='' |
| local MANUAL_ENTRIES=$(cli_getFilesList \ |
| $(dirname ${MANUAL_ENTRY_DST}) \ |
| --pattern="${MANUAL_ENTRY_DST}.*\.${MANUAL_EXTENSION}") |
| |
| |
| cli_printMessage '-' --as-separator-line |
| |
| |
| cli_printMessage "`gettext "Updating menus, nodes and cross-references."`" --as-response-line |
| |
| |
| |
| |
| |
| for MANUAL_ENTRY in ${MANUAL_ENTRIES};do |
| |
| |
| |
| ${MANUAL_BACKEND}_updateMenu |
| ${MANUAL_BACKEND}_updateNodes |
| |
| |
| |
| ${MANUAL_BACKEND}_restoreCrossReferences $MANUAL_ENTRY |
| |
| done |
| |
| } |