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

4c79b5
#!/bin/bash
4c79b5
#
d92dde
# texinfo_deleteEntry.sh -- This function removes a documentation
d92dde
# manuals, chapters or sections from the working copy.
4c79b5
#
2fe9b7
# Copyright (C) 2009, 2010, 2011 The CentOS Project
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
4c79b5
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4c79b5
# General Public License for more details.
4c79b5
#
4c79b5
# You should have received a copy of the GNU General Public License
4c79b5
# along with this program; if not, write to the Free Software
dcd347
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
7ac5a5
#
4c79b5
# ----------------------------------------------------------------------
418249
# $Id$
4c79b5
# ----------------------------------------------------------------------
4c79b5
993f6a
function texinfo_deleteEntry {
4c79b5
449927
    # Print separator line.
18be6e
    cli_printMessage '-' --as-separator-line
449927
d92dde
    # Remove manual, chapter or section based on documentation entry
d92dde
    # provided as non-option argument to `centos-art.sh' script.  
e0c375
    if [[ ${MANUAL_SECT[$MANUAL_DOCENTRY_ID]} != '' ]];then
d92dde
d92dde
        # When a section is deleted, documentation entry points to a
d92dde
        # section name. In this configuration, documentation entry is
d92dde
        # deleted through subversion in order to register the change.
d92dde
        # Once the documentation entry is deleted, the section menu
d92dde
        # and nodes definition files are updated to keep manual in a
d92dde
        # consistent state.
ef43e2
        texinfo_deleteEntrySection
d92dde
e0c375
    elif [[ ${MANUAL_CHAP[$MANUAL_DOCENTRY_ID]} != '' ]];then
d92dde
d92dde
        # When a chapter is deleted, documentation entry doesn't point
d92dde
        # to a section name but a chapter name. In this configuration,
d92dde
        # it is necessary to build a list of all the section entries
d92dde
        # available inside the chapter before deleting it. Once the
d92dde
        # chapter has been marked for deletion, it is time to update
d92dde
        # chapter definition files and later section definition files
d92dde
        # using the list of section entries previously defined.
d92dde
        # Actualization of section definition files must be done one
d92dde
        # at a time because menu entries related to section
d92dde
        # definitions are updated one at a time.
ef43e2
        texinfo_deleteEntryChapter
d92dde
d92dde
    elif [[ ${MANUAL_DIRN[$MANUAL_DOCENTRY_ID]} != '' ]];then
d92dde
d92dde
        # When a manual is deleted, documentation entry doesnt' point
d92dde
        # to either a section or chapter but a manual name only. In
d92dde
        # this configuration the entire manual directory is marked for
d92dde
        # deletion, and that way processed.
ef43e2
        texinfo_deleteEntryManual
d92dde
d92dde
    else
d92dde
        cli_printMessage "`gettext "The parameters you provided are not supported."`" --as-error-line
d92dde
    fi
4456e8
f8fb31
4c79b5
}