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

Alain Reguera Delgado 8f60cb
#!/bin/bash
Alain Reguera Delgado 8f60cb
#
Alain Reguera Delgado 8f60cb
# texinfo_deleteEntry.sh -- This function removes a documentation
Alain Reguera Delgado 8f60cb
# manuals, chapters or sections from 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_deleteEntry {
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
    # Remove manual, chapter or section based on documentation entry
Alain Reguera Delgado 8f60cb
    # provided as non-option argument to `centos-art.sh' script.  
Alain Reguera Delgado 8f60cb
    if [[ ${MANUAL_SECT[$MANUAL_DOCENTRY_ID]} != '' ]];then
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
        # When a section is deleted, documentation entry points to a
Alain Reguera Delgado 8f60cb
        # section name. In this configuration, documentation entry is
Alain Reguera Delgado 8f60cb
        # deleted through subversion in order to register the change.
Alain Reguera Delgado 8f60cb
        # Once the documentation entry is deleted, the section menu
Alain Reguera Delgado 8f60cb
        # and nodes definition files are updated to keep manual in a
Alain Reguera Delgado 8f60cb
        # consistent state.
Alain Reguera Delgado 8f60cb
        texinfo_deleteEntrySection
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
    elif [[ ${MANUAL_CHAP[$MANUAL_DOCENTRY_ID]} != '' ]];then
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
        # When a chapter is deleted, documentation entry doesn't point
Alain Reguera Delgado 8f60cb
        # to a section name but a chapter name. In this configuration,
Alain Reguera Delgado 8f60cb
        # it is necessary to build a list of all the section entries
Alain Reguera Delgado 8f60cb
        # available inside the chapter before deleting it. Once the
Alain Reguera Delgado 8f60cb
        # chapter has been marked for deletion, it is time to update
Alain Reguera Delgado 8f60cb
        # chapter definition files and later section definition files
Alain Reguera Delgado 8f60cb
        # using the list of section entries previously defined.
Alain Reguera Delgado 8f60cb
        # Actualization of section definition files must be done one
Alain Reguera Delgado 8f60cb
        # at a time because menu entries related to section
Alain Reguera Delgado 8f60cb
        # definitions are updated one at a time.
Alain Reguera Delgado 8f60cb
        texinfo_deleteEntryChapter
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
    elif [[ ${MANUAL_DIRN[$MANUAL_DOCENTRY_ID]} != '' ]];then
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
        # When a manual is deleted, documentation entry doesnt' point
Alain Reguera Delgado 8f60cb
        # to either a section or chapter but a manual name only. In
Alain Reguera Delgado 8f60cb
        # this configuration the entire manual directory is marked for
Alain Reguera Delgado 8f60cb
        # deletion, and that way processed.
Alain Reguera Delgado 8f60cb
        texinfo_deleteEntryManual
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
Alain Reguera Delgado 8f60cb
}