Blame Automation/Modules/Help/Texinfo/texinfo_copyEntry.sh

Alain Reguera Delgado 8f60cb
#!/bin/bash
Alain Reguera Delgado 8f60cb
#
Alain Reguera Delgado 8f60cb
# texinfo_copyEntry.sh -- This function standardizes the duplication
Alain Reguera Delgado 8f60cb
# actions related to manuals written in texinfo format. This function
Alain Reguera Delgado 8f60cb
# duplicates manuals, chapters inside manuals, and sections inside
Alain Reguera Delgado 8f60cb
# chapters.
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_copyEntry {
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
    # Initialize source and target locations.
Alain Reguera Delgado 8f60cb
    local MANUAL_ENTRY_SRC=''
Alain Reguera Delgado 8f60cb
    local MANUAL_ENTRY_DST=''
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
    # Execute copying action based on documentation entries passed as
Alain Reguera Delgado 8f60cb
    # non-option arguments to `centos-art.sh' script in the
Alain Reguera Delgado 8f60cb
    # command-line.
Alain Reguera Delgado 8f60cb
    if [[ ${MANUAL_SECT[${MANUAL_DOCENTRY_ID}]} != '' ]];then
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
        # In this configuration, the section name is specified in
Alain Reguera Delgado 8f60cb
        # first non-option argument and optionally in the second
Alain Reguera Delgado 8f60cb
        # non-option argument.
Alain Reguera Delgado 8f60cb
        texinfo_copyEntrySection
Alain Reguera Delgado 8f60cb
         
Alain Reguera Delgado 8f60cb
    elif [[ ${MANUAL_CHAP[${MANUAL_DOCENTRY_ID}]} != '' ]] \
Alain Reguera Delgado 8f60cb
        && [[ ${MANUAL_CHAP[((${MANUAL_DOCENTRY_ID} + 1))]} != '' ]];then
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
        # In this configuration, the section name wasn't specified
Alain Reguera Delgado 8f60cb
        # neither in first or second non-option argument.  So, we
Alain Reguera Delgado 8f60cb
        # perform a copying action for the chapter directory itself.
Alain Reguera Delgado 8f60cb
        # In this configuration, the whole chapter directory and all
Alain Reguera Delgado 8f60cb
        # the content inside are duplicated from source to target.
Alain Reguera Delgado 8f60cb
        texinfo_copyEntryChapter
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
    elif [[ ${MANUAL_DIRN[${MANUAL_DOCENTRY_ID}]} != '' ]] \
Alain Reguera Delgado 8f60cb
        && [[ ${MANUAL_DIRN[((${MANUAL_DOCENTRY_ID} + 1))]} != '' ]];then
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
        # In this configuration, the chapter name wasn't specified
Alain Reguera Delgado 8f60cb
        # neither in first or second non-option argument. So, we
Alain Reguera Delgado 8f60cb
        # perform copying actions on manual directory itself.  Notice
Alain Reguera Delgado 8f60cb
        # that, in this configuration, the whole manual is duplicated.
Alain Reguera Delgado 8f60cb
        texinfo_copyEntryManual
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
        # In this configuration, there is no need to update section
Alain Reguera Delgado 8f60cb
        # menus, nodes and cross references. The section definition
Alain Reguera Delgado 8f60cb
        # files were copied from the source manual with any change so
Alain Reguera Delgado 8f60cb
        # the manual should build without any problem. Be sure such
Alain Reguera Delgado 8f60cb
        # verification will never happen.
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
    else
Alain Reguera Delgado 8f60cb
        cli_printMessage "`gettext "The parameters you provided are not supported."`" --as-error-line
Alain Reguera Delgado 8f60cb
    fi
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
}