Blame Scripts/centos-art/Functions/Help/Texinfo/texinfo_deleteEntryManual.sh

d92dde
#!/bin/bash
d92dde
#
d92dde
# texinfo_deleteEntryManual.sh -- This function standardized manual
d92dde
# deletion inside the working copy.
d92dde
#
2fe9b7
# Copyright (C) 2009, 2010, 2011 The CentOS Project
d92dde
#
d92dde
# This program is free software; you can redistribute it and/or modify
d92dde
# it under the terms of the GNU General Public License as published by
d92dde
# the Free Software Foundation; either version 2 of the License, or (at
d92dde
# your option) any later version.
d92dde
#
d92dde
# This program is distributed in the hope that it will be useful, but
d92dde
# WITHOUT ANY WARRANTY; without even the implied warranty of
d92dde
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
d92dde
# General Public License for more details.
d92dde
#
d92dde
# You should have received a copy of the GNU General Public License
d92dde
# along with this program; if not, write to the Free Software
d92dde
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
d92dde
#
d92dde
# ----------------------------------------------------------------------
d92dde
# $Id$
d92dde
# ----------------------------------------------------------------------
d92dde
d92dde
function texinfo_deleteEntryManual {
d92dde
c572ed
    # Print action message.
c572ed
    cli_printMessage "$MANUAL_ENTRY" --as-deleting-line
c572ed
c572ed
    # Verify existence of documentation entry before deleting it. We
c572ed
    # cannot delete an entry which doesn't exist.
c572ed
    cli_checkFiles "$MANUAL_ENTRY"
c572ed
c572ed
    # Revert pending changes before deleting.
c572ed
    svn revert ${MANUAL_BASEDIR_L10N} --quiet --recursive
c572ed
d92dde
    # Remove locale-specific documentation manual directory from the
d92dde
    # working copy. Using subversion to register the change. Be sure
d92dde
    # that related output files are removed too.
d92dde
    svn del ${MANUAL_BASEDIR_L10N} --quiet --force
d92dde
d92dde
    # Verify manual base directory. When the locale-specific
d92dde
    # documentaion manual is the last one inside the manual base
d92dde
    # directory, remove the manual base directory from the working
d92dde
    # copy.  There is no need to have an empty manual base directories
d92dde
    # inside the working copy.
d92dde
    if [[ $(ls -1 $MANUAL_BASEDIR | wc -l) -le 1 ]];then
d92dde
d92dde
        # Remove manual base directory.
e7414c
        svn del ${MANUAL_BASEDIR} --quiet --force
d92dde
115094
        # Redefine absolute paths to changed directory.  This is
115094
        # required in order for `cli_commitRepoChanges' to be aware
115094
        # that we are deleting MANUAL_BASEDIR, not
115094
        # MANUAL_BASEDIR_L10N.
115094
        MANUAL_CHANGED_DIRS="${MANUAL_BASEDIR}"
115094
d92dde
    fi
d92dde
d92dde
}