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