Blame Scripts/Functions/Help/Texinfo/texinfo_copyEntry.sh

2bd980
#!/bin/bash
2bd980
#
edaa9d
# texinfo_copyEntry.sh -- This function standardizes the duplication
edaa9d
# actions related to manuals written in texinfo format. This function
edaa9d
# duplicates manuals, chapters inside manuals, and sections inside
edaa9d
# chapters.
2bd980
#
3b0984
# Copyright (C) 2009, 2010, 2011 The CentOS Artwork SIG
fa95b1
#
fa95b1
# This program is free software; you can redistribute it and/or modify
fa95b1
# it under the terms of the GNU General Public License as published by
dcd347
# the Free Software Foundation; either version 2 of the License, or (at
dcd347
# your option) any later version.
fa95b1
#
74a058
# This program is distributed in the hope that it will be useful, but
74a058
# WITHOUT ANY WARRANTY; without even the implied warranty of
2bd980
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2bd980
# General Public License for more details.
2bd980
#
2bd980
# You should have received a copy of the GNU General Public License
2bd980
# along with this program; if not, write to the Free Software
dcd347
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
7ac5a5
#
2bd980
# ----------------------------------------------------------------------
2bd980
# $Id$
2bd980
# ----------------------------------------------------------------------
2bd980
993f6a
function texinfo_copyEntry {
56f126
edaa9d
    local MANUAL_ENTRY_SRC=''
edaa9d
    local MANUAL_ENTRY_DST=''
edaa9d
    local MANUAL_ENTRY=''
edaa9d
    local MANUAL_ENTRIES=''
b45dde
e7414c
    # Execute copying action based on documentation entries passed as
e7414c
    # non-option arguments to `centos-art.sh' script in the
e7414c
    # command-line.
edaa9d
    if [[ ${MANUAL_SECN[${MANUAL_DOCENTRY_ID}]} != '' ]];then
a484de
e7414c
        # In this configuration, the section name is specified in
e7414c
        # first non-option argument and optionally in the second
e7414c
        # non-option arugment.
edaa9d
        ${FLAG_BACKEND}_copyEntrySection
edaa9d
         
edaa9d
    elif [[ ${MANUAL_CHAN[${MANUAL_DOCENTRY_ID}]} != '' ]] \
edaa9d
        && [[ ${MANUAL_CHAN[((${MANUAL_DOCENTRY_ID} + 1))]} != '' ]];then
edaa9d
edaa9d
        # In this configuration, the section name wasn't specified
edaa9d
        # neither in first or second non-option argument.  So, we
edaa9d
        # perform a copying action for the chapter directory itself.
edaa9d
        # In this configuration, the whole chapter directory and all
e7414c
        # the content inside are duplicated from source to target.
edaa9d
        ${FLAG_BACKEND}_copyEntryChapter
edaa9d
edaa9d
    elif [[ ${MANUAL_DIRN[${MANUAL_DOCENTRY_ID}]} != '' ]] \
edaa9d
        && [[ ${MANUAL_DIRN[((${MANUAL_DOCENTRY_ID} + 1))]} != '' ]];then
edaa9d
edaa9d
        # In this configuration, the chapter name wasn't specified
edaa9d
        # neither in first or second non-option argument. So, we
edaa9d
        # perform copying actions on manual directory itself.  Notice
edaa9d
        # that, in this configuration, the whole manual is duplicated.
edaa9d
        ${FLAG_BACKEND}_copyEntryManual
edaa9d
edaa9d
        # In this configuration, there is no need to update section
edaa9d
        # menus, nodes and cross refereces. The section definition
edaa9d
        # files were copied from the source manual with any change so
edaa9d
        # the manual should build without any problem. Be sure such
edaa9d
        # verification will never happen.
2bd980
edaa9d
    else
edaa9d
        cli_printMessage "`gettext "The parameters you provided are not supported."`" --as-error-line
edaa9d
    fi
2bd980
2bd980
}