|
|
878a2b |
#!/bin/bash
|
|
|
878a2b |
#
|
|
|
878a2b |
# texinfo_copyEntrySection.sh -- This function standardizes section
|
|
|
878a2b |
# duplication inside manuals written in texinfo format.
|
|
|
878a2b |
#
|
|
|
878a2b |
# Copyright (C) 2009, 2010, 2011 The CentOS Project
|
|
|
878a2b |
#
|
|
|
878a2b |
# This program is free software; you can redistribute it and/or modify
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
#
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
# General Public License for more details.
|
|
|
878a2b |
#
|
|
|
878a2b |
|
|
|
878a2b |
# along with this program; if not, write to the Free Software
|
|
|
878a2b |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
878a2b |
#
|
|
|
878a2b |
# ----------------------------------------------------------------------
|
|
|
878a2b |
# $Id$
|
|
|
878a2b |
# ----------------------------------------------------------------------
|
|
|
878a2b |
|
|
|
878a2b |
function texinfo_copyEntrySection {
|
|
|
878a2b |
|
|
|
878a2b |
# Define absolute path to section source and target locations
|
|
|
878a2b |
|
|
|
878a2b |
if [[ ${MANUAL_SECT[((${MANUAL_DOCENTRY_ID} + 1))]} != '' ]];then
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
# in first and second non-option arguments respectively.
|
|
|
878a2b |
MANUAL_ENTRY_SRC=$(texinfo_getEntry ${MANUAL_SECT[${MANUAL_DOCENTRY_ID}]})
|
|
|
878a2b |
MANUAL_ENTRY_DST=$(texinfo_getEntry ${MANUAL_SECT[((${MANUAL_DOCENTRY_ID} + 1))]})
|
|
|
878a2b |
|
|
|
878a2b |
elif [[ ${MANUAL_SECT[((${MANUAL_DOCENTRY_ID} + 1))]} == '' ]] \
|
|
|
878a2b |
&& [[ ${MANUAL_CHAP[((${MANUAL_DOCENTRY_ID} + 1))]} != '' ]];then
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
MANUAL_ENTRY_SRC=$(texinfo_getEntry ${MANUAL_SECT[${MANUAL_DOCENTRY_ID}]})
|
|
|
878a2b |
MANUAL_ENTRY_DST=$(echo $MANUAL_ENTRY_SRC \
|
|
|
878a2b |
| sed -r "s!${MANUAL_CHAP[${MANUAL_DOCENTRY_ID}]}!${MANUAL_CHAP[((${MANUAL_DOCENTRY_ID} + 1))]}!")
|
|
|
878a2b |
|
|
|
878a2b |
else
|
|
|
878a2b |
cli_printMessage "`gettext "The location provided as target isn't valid."`" --as-error-line
|
|
|
878a2b |
fi
|
|
|
878a2b |
|
|
|
878a2b |
# Print separator line along with action message.
|
|
|
878a2b |
cli_printMessage '-' --as-separator-line
|
|
|
878a2b |
cli_printMessage "${MANUAL_ENTRY_DST}" --as-creating-line
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
texinfo_checkEntrySrcDst "${MANUAL_ENTRY_SRC}" "${MANUAL_ENTRY_DST}"
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
svn cp "${MANUAL_ENTRY_SRC}" "${MANUAL_ENTRY_DST}" --quiet
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
local MANUAL_CHAPTER_NAME=${MANUAL_CHAP[((${MANUAL_DOCENTRY_ID} + 1))]}
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
local MANUAL_CHAPTER_DIR=$(dirname ${MANUAL_ENTRY_DST})
|
|
|
878a2b |
|
|
|
878a2b |
# At this point, all copying actions and chapter related
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
texinfo_updateStructureSection "${MANUAL_ENTRY_DST}"
|
|
|
878a2b |
|
|
|
878a2b |
}
|