Blame Automation/Modules/centos-art.sh-help/Texinfo/texinfo_renameEntryManual.sh

Alain Reguera Delgado 8f60cb
#!/bin/bash
Alain Reguera Delgado 8f60cb
#
Alain Reguera Delgado 8f60cb
# texinfo_renameEntryManual.sh -- This function standardizes renaming
Alain Reguera Delgado 8f60cb
# tasks related to documenation manuals written in texinfo format
Alain Reguera Delgado 8f60cb
# inside the working copy.
Alain Reguera Delgado 8f60cb
#
Alain Reguera Delgado 8f60cb
# Copyright (C) 2009-2013 The CentOS Project
Alain Reguera Delgado 8f60cb
#
Alain Reguera Delgado 8f60cb
# This program is free software; you can redistribute it and/or modify
Alain Reguera Delgado 8f60cb
# it under the terms of the GNU General Public License as published by
Alain Reguera Delgado 8f60cb
# the Free Software Foundation; either version 2 of the License, or (at
Alain Reguera Delgado 8f60cb
# your option) any later version.
Alain Reguera Delgado 8f60cb
#
Alain Reguera Delgado 8f60cb
# This program is distributed in the hope that it will be useful, but
Alain Reguera Delgado 8f60cb
# WITHOUT ANY WARRANTY; without even the implied warranty of
Alain Reguera Delgado 8f60cb
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Alain Reguera Delgado 8f60cb
# General Public License for more details.
Alain Reguera Delgado 8f60cb
#
Alain Reguera Delgado 8f60cb
# You should have received a copy of the GNU General Public License
Alain Reguera Delgado 8f60cb
# along with this program; if not, write to the Free Software
Alain Reguera Delgado 8f60cb
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Alain Reguera Delgado 8f60cb
#
Alain Reguera Delgado 8f60cb
# ----------------------------------------------------------------------
Alain Reguera Delgado 8f60cb
# $Id$
Alain Reguera Delgado 8f60cb
# ----------------------------------------------------------------------
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
function texinfo_renameEntryManual {
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
    # Copy section source entry to target location.
Alain Reguera Delgado 8f60cb
    texinfo_copyEntryManual
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
    # Delete section source entry.
Alain Reguera Delgado 8f60cb
    texinfo_deleteEntryManual
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
    # Redefine absolute paths to changed directories.  This is
Alain Reguera Delgado 8f60cb
    # required in order for `cli_synchronizeRepoChanges' to be aware
Alain Reguera Delgado 8f60cb
    # of manual source and target locations we've just renamed.
Alain Reguera Delgado 8f60cb
    MANUAL_CHANGED_DIRS="${MANUAL_BASEDIR} $(echo $MANUAL_BASEDIR \
Alain Reguera Delgado 8f60cb
        | sed -r "s!${MANUAL_DIRN[${MANUAL_DOCENTRY_ID}]}!${MANUAL_DIRN[((${MANUAL_DOCENTRY_ID} + 1))]}!")"
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
    # From this time on, the manual information set so far is no
Alain Reguera Delgado 8f60cb
    # longer useful. Redefine it to start using the new manual
Alain Reguera Delgado 8f60cb
    # information instead.
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
    # Redefine manual name using manual name passed to `centos-art.sh'
Alain Reguera Delgado 8f60cb
    # script as second non-option argument.
Alain Reguera Delgado 8f60cb
    MANUAL_NAME=${MANUAL_SLFN[((${MANUAL_DOCENTRY_ID} + 1))]}
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
    # Redefine absolute path to manual directory using manual name
Alain Reguera Delgado 8f60cb
    # passed to `centos-art.sh' script as second non-option argument.
Alain Reguera Delgado 8f60cb
    MANUAL_BASEDIR="$(echo $MANUAL_BASEDIR \
Alain Reguera Delgado 8f60cb
        | sed -r "s!${MANUAL_DIRN[${MANUAL_DOCENTRY_ID}]}!${MANUAL_DIRN[((${MANUAL_DOCENTRY_ID} + 1))]}!")"
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
    # Redefine absolute path to manual directory using manual name
Alain Reguera Delgado 8f60cb
    # passed to `centos-art.sh' script as second non-option argument.
Alain Reguera Delgado 8f60cb
    MANUAL_BASEDIR_L10N="${MANUAL_BASEDIR}/${MANUAL_L10N}"
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
    # Redefine absolute path to base file using manual name passed to
Alain Reguera Delgado 8f60cb
    # `centos-art.sh' script as second non-option argument.
Alain Reguera Delgado 8f60cb
    MANUAL_BASEFILE="${MANUAL_BASEDIR_L10N}/${MANUAL_NAME}"
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
}