Blame Scripts/Functions/Help/Backends/Texinfo/texinfo.sh

5bf56f
#!/bin/bash
5bf56f
#
5bf56f
# texinfo.sh -- This function redefines backend-specific variables.
5bf56f
#
5bf56f
# Copyright (C) 2009, 2010, 2011 The CentOS Project
5bf56f
#
5bf56f
# This program is free software; you can redistribute it and/or modify
5bf56f
# it under the terms of the GNU General Public License as published by
5bf56f
# the Free Software Foundation; either version 2 of the License, or (at
5bf56f
# your option) any later version.
5bf56f
#
5bf56f
# This program is distributed in the hope that it will be useful, but
5bf56f
# WITHOUT ANY WARRANTY; without even the implied warranty of
5bf56f
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
5bf56f
# General Public License for more details.
5bf56f
#
5bf56f
# You should have received a copy of the GNU General Public License
5bf56f
# along with this program; if not, write to the Free Software
5bf56f
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
5bf56f
#
5bf56f
# ----------------------------------------------------------------------
5bf56f
# $Id$
5bf56f
# ----------------------------------------------------------------------
5bf56f
    
5bf56f
function texinfo {
5bf56f
5bf56f
    # Define documentation entry.
5bf56f
    ENTRY=$(${FLAG_BACKEND}_getEntry)
5bf56f
5bf56f
    # Define directory to store documentation entries.
5bf56f
    MANUAL_CHAPTER_DIR=$(${FLAG_BACKEND}_getChapterDir "$ENTRY")
5bf56f
5bf56f
    # Define chapter name for documentation entry we're working with.
5bf56f
    MANUAL_CHAPTER_NAME=$(basename "$MANUAL_CHAPTER_DIR")
5bf56f
5bf56f
    # Define documentation entry directory. This is the directory
5bf56f
    # where the entry file is stored.  When the file extension be
5bf56f
    # removed, consider that several backends could be used.
5bf56f
    ENTRY_DIR=$(dirname ${ENTRY} | sed -r "s/\.${FLAG_BACKEND}$//")
5bf56f
5bf56f
    # Define documentation entry file (without extension).
5bf56f
    ENTRY_FILE=$(basename ${ENTRY} | sed -r "s/\.${FLAG_BACKEND}$//")
5bf56f
5bf56f
    # Syncronize changes between repository and working copy. At this
5bf56f
    # point, changes in the repository are merged in the working copy
5bf56f
    # and changes in the working copy committed up to repository.
5bf56f
    cli_syncroRepoChanges ${MANUAL_CHAPTER_DIR}
5bf56f
5bf56f
    # Verify action name against the file ought to be initialized
5bf56f
    # from. If the file exists it is very sure that it has been
5bf56f
    # already initialized, so execute the action name. Otherwise, if
5bf56f
    # the file doesn't exist, print an error message. It is not
5bf56f
    # possible to execute a function which definition hasn't been
5bf56f
    # initialized.
5bf56f
    if [[ -f ${FUNCDIR}/${FUNCDIRNAM}/${ACTIONNAM}.sh  ]];then
5bf56f
        $ACTIONNAM 
5bf56f
    else
5bf56f
        cli_printMessage "`gettext "A valid action is required."`" --as-error-line 
5bf56f
    fi
5bf56f
5bf56f
    # Commit changes from working copy to central repository only.  At
5bf56f
    # this point, changes in the repository are not merged in the
5bf56f
    # working copy, but chages in the working copy do are committed up
5bf56f
    # to repository.
5bf56f
    cli_commitRepoChanges ${MANUAL_CHAPTER_DIR}
5bf56f
5bf56f
}