Blame Scripts/Bash/Functions/Help/Texinfo/texinfo_deleteEntry.sh

878a2b
#!/bin/bash
878a2b
#
878a2b
# texinfo_deleteEntry.sh -- This function removes a documentation
878a2b
# manuals, chapters or sections from the working copy.
878a2b
#
03486a
# Copyright (C) 2009, 2010, 2011, 2012 The CentOS Project
878a2b
#
878a2b
# This program is free software; you can redistribute it and/or modify
878a2b
# it under the terms of the GNU General Public License as published by
878a2b
# the Free Software Foundation; either version 2 of the License, or (at
878a2b
# your option) any later version.
878a2b
#
878a2b
# This program is distributed in the hope that it will be useful, but
878a2b
# WITHOUT ANY WARRANTY; without even the implied warranty of
878a2b
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
878a2b
# General Public License for more details.
878a2b
#
878a2b
# You should have received a copy of the GNU General Public License
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_deleteEntry {
878a2b
878a2b
    # Print separator line.
878a2b
    cli_printMessage '-' --as-separator-line
878a2b
878a2b
    # Remove manual, chapter or section based on documentation entry
878a2b
    # provided as non-option argument to `centos-art.sh' script.  
878a2b
    if [[ ${MANUAL_SECT[$MANUAL_DOCENTRY_ID]} != '' ]];then
878a2b
878a2b
        # When a section is deleted, documentation entry points to a
878a2b
        # section name. In this configuration, documentation entry is
878a2b
        # deleted through subversion in order to register the change.
878a2b
        # Once the documentation entry is deleted, the section menu
878a2b
        # and nodes definition files are updated to keep manual in a
878a2b
        # consistent state.
878a2b
        texinfo_deleteEntrySection
878a2b
878a2b
    elif [[ ${MANUAL_CHAP[$MANUAL_DOCENTRY_ID]} != '' ]];then
878a2b
878a2b
        # When a chapter is deleted, documentation entry doesn't point
878a2b
        # to a section name but a chapter name. In this configuration,
878a2b
        # it is necessary to build a list of all the section entries
878a2b
        # available inside the chapter before deleting it. Once the
878a2b
        # chapter has been marked for deletion, it is time to update
878a2b
        # chapter definition files and later section definition files
878a2b
        # using the list of section entries previously defined.
878a2b
        # Actualization of section definition files must be done one
878a2b
        # at a time because menu entries related to section
878a2b
        # definitions are updated one at a time.
878a2b
        texinfo_deleteEntryChapter
878a2b
878a2b
    elif [[ ${MANUAL_DIRN[$MANUAL_DOCENTRY_ID]} != '' ]];then
878a2b
878a2b
        # When a manual is deleted, documentation entry doesnt' point
878a2b
        # to either a section or chapter but a manual name only. In
878a2b
        # this configuration the entire manual directory is marked for
878a2b
        # deletion, and that way processed.
878a2b
        texinfo_deleteEntryManual
878a2b
878a2b
    else
878a2b
        cli_printMessage "`gettext "The parameters you provided are not supported."`" --as-error-line
878a2b
    fi
878a2b
878a2b
878a2b
}