From 8c92a7cc47e878fc37a2b7bf87966f30077bba77 Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Nov 01 2013 05:35:04 +0000 Subject: Remove help functionality from centos-art.sh script. - Before discovering Asciidoc, the help functionality was thought to reduce the number of actions required to write documentation in a standard way using different formats like Texinfo and Docbook. But now, that Asciidoc is being adopted as default documentation format inside the repository there is really no need of a help functionality. Asciidoc is so simple to write and structure that there is no need of a tool for such tasks. All documentation related to Texinfo format should be removed as well. --- diff --git a/Automation/Modules/Help/Texinfo/texinfo.sh b/Automation/Modules/Help/Texinfo/texinfo.sh deleted file mode 100755 index 8e5951f..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo.sh +++ /dev/null @@ -1,136 +0,0 @@ -#!/bin/bash -# -# texinfo.sh -- This function initializes Texinfo documentation format -# used by `centos-art.sh' script to produce and maintain documentation -# manuals written in Texinfo format, inside the working copy of The -# CentOS Artwork Repository. -# -# Copyright (C) 2009-2013 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 { - - # Verify documentation entry to be sure it coincides with - # Texinfo's supported structuring (e.g., texinfo-4.8 doesn't - # support structuring through parts, but chapters and sections - # only). - if [[ $MANUAL_PART_NAME != '' ]];then - cli_printMessage "`gettext "The documentation entry provided isn't supported."`" --as-error-line - fi - - # Verify documentation format based on file type. - if [[ -f ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} ]];then - cli_checkFiles -i "text/x-texinfo" ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} - fi - - # Define absolute path to template directory. This is the place - # where we store locale directories (e.g., en_US, es_ES, etc.) - # used to build manuals in texinfo format. - MANUAL_TEMPLATE=${MANUAL_TLDIR}/$(cli_getRepoName ${FLAG_FORMAT} -d)/Default - - # Define absolute path to language-specific template directory. - # This is the place where we store locale-specific files used to - # build manuals in texinfo format. - MANUAL_TEMPLATE_L10N=${MANUAL_TEMPLATE}/${MANUAL_L10N} - - # Verify absolute path to language-specific template directory. - # If it doesn't exist, use English language as default location to - # retrieve template files. - if [[ ! -d $MANUAL_TEMPLATE_L10N ]];then - MANUAL_TEMPLATE_L10N=${MANUAL_TEMPLATE}/en_US - fi - - # Initialize document structure for new manuals. - texinfo_createStructure - - # Define documentation entry default values. To build the - # documentation entry, we combine the manual's name, part, chapter - # and section information retrieved from the command-line. - if [[ $MANUAL_CHAPTER_NAME == '' ]];then - - # When chapter option is not provided, discard the section - # name and define documentation entry based on manual's main - # definition file. - MANUAL_ENTRY="${MANUAL_BASEFILE}.${MANUAL_EXTENSION}" - - elif [[ $MANUAL_CHAPTER_NAME != '' ]] && [[ $MANUAL_SECTION_NAME == '' ]];then - - # When chapter option is provided without a section name, - # verify chapter's directory inside the manual, - texinfo_createChapter - - # and define documentation entry based on chapter's main - # definition file. - MANUAL_ENTRY="${MANUAL_BASEDIR_L10N}/${MANUAL_CHAPTER_NAME}.${MANUAL_EXTENSION}" - - elif [[ $MANUAL_CHAPTER_NAME != '' ]] && [[ $MANUAL_SECTION_NAME != '' ]];then - - # When both the chapter option and non-option arguments are - # provided, define documentation entries based on manual, - # chapter and non-option arguments. - MANUAL_ENTRY="$(texinfo_getEntry "$MANUAL_SECTION_NAME")" - - else - cli_printMessage "`gettext "The parameters you provided are not supported."`" --as-error-line - fi - - # Execute action names. Notice that we've separated execution of - # action names in order to control and save differences among - # them. - if [[ $ACTIONNAM == "" ]];then - - # When no action name is provided to `centos-art.sh' script, - # read manual's info output in order to provide a way for - # people to get oriented about The CentOS Artwork Repository - # and its automation too. Be sure the manual and its info - # output file do exist. Later, once the reading is done, - # terminate the script execution. - - # Update manual's output files. - texinfo_updateOutputFiles - - # Read manual's Top node from its info output file. - info --node="Top" --file="${MANUAL_OUTPUT_BASEFILE}.info.bz2" - - elif [[ $ACTIONNAM =~ "^(copy|rename|delete)Entry$" ]];then - - # Both `--copy' and `--rename' actions interpret non-option - # arguments passed to `centos-art.sh' script in a special way. - # In this configuration, only two non-option arguments are - # processed in the first loop of their interpretation. - texinfo_${ACTIONNAM} - - # Rebuild output files to propagate recent changes, if any. - texinfo_updateOutputFiles - - # Break interpretation of non-option arguments to prevent the - # second and further non-option arguments from being - # considered as source location. - break - - else - - # Execute action names as part of normal help command's - # execution flow, without any extra modification. - texinfo_${ACTIONNAM} - - fi - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_checkEntrySrcDst.sh b/Automation/Modules/Help/Texinfo/texinfo_checkEntrySrcDst.sh deleted file mode 100755 index 3bb829d..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_checkEntrySrcDst.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash -# -# texinfo_checkEntrySrcDst.sh -- This function standardizes -# verification actions of source and target locations for tasks like -# copying and renaming. -# -# Copyright (C) 2009-2013 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_checkEntrySrcDst { - - # Initialize entry source absolute path. - local MANUAL_ENTRY_SRC="$1" - - # Initialize entry target absolute path. - local MANUAL_ENTRY_DST="$2" - - # Verify existence of source location. - if [[ ! -a ${MANUAL_ENTRY_SRC} ]];then - cli_printMessage "`gettext "The source location doesn't exist."`" --as-error-line - fi - - # Verify source and target locations to be sure they are different - # one another. We cannot copy a source location to itself. - if [[ $MANUAL_ENTRY_SRC == $MANUAL_ENTRY_DST ]];then - cli_printMessage "`gettext "The source and target locations cannot be the same."`" --as-error-line - fi - - # Verify source location to be sure it is under version control - # and there isn't pending change to be committed first. - cli_checkFiles ${MANUAL_ENTRY_SRC} --is-versioned - if [[ $(cli_runFnEnvironment vcs --status ${MANUAL_ENTRY_SRC}) != '' ]];then - cli_printMessage "`gettext "The source location has pending changes."`" --as-error-line - fi - - # Verify target directory where the source will be duplicated in. - # The target directory must exist before copying the source - # location into it. If it doesn't exist, use subversion to create - # it it. - if [[ ! -d $(dirname ${MANUAL_ENTRY_DST}) ]];then - cli_runFnEnvironment vcs --mkdir $(dirname ${MANUAL_ENTRY_DST}) - fi - - # Verify existence of target location. - if [[ -a ${MANUAL_ENTRY_DST} ]];then - cli_printMessage "`gettext "The target location already exists."`" --as-error-line - fi - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_copyEntry.sh b/Automation/Modules/Help/Texinfo/texinfo_copyEntry.sh deleted file mode 100755 index 8bedf1e..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_copyEntry.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash -# -# texinfo_copyEntry.sh -- This function standardizes the duplication -# actions related to manuals written in texinfo format. This function -# duplicates manuals, chapters inside manuals, and sections inside -# chapters. -# -# Copyright (C) 2009-2013 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_copyEntry { - - # Initialize source and target locations. - local MANUAL_ENTRY_SRC='' - local MANUAL_ENTRY_DST='' - - # Execute copying action based on documentation entries passed as - # non-option arguments to `centos-art.sh' script in the - # command-line. - if [[ ${MANUAL_SECT[${MANUAL_DOCENTRY_ID}]} != '' ]];then - - # In this configuration, the section name is specified in - # first non-option argument and optionally in the second - # non-option argument. - texinfo_copyEntrySection - - elif [[ ${MANUAL_CHAP[${MANUAL_DOCENTRY_ID}]} != '' ]] \ - && [[ ${MANUAL_CHAP[((${MANUAL_DOCENTRY_ID} + 1))]} != '' ]];then - - # In this configuration, the section name wasn't specified - # neither in first or second non-option argument. So, we - # perform a copying action for the chapter directory itself. - # In this configuration, the whole chapter directory and all - # the content inside are duplicated from source to target. - texinfo_copyEntryChapter - - elif [[ ${MANUAL_DIRN[${MANUAL_DOCENTRY_ID}]} != '' ]] \ - && [[ ${MANUAL_DIRN[((${MANUAL_DOCENTRY_ID} + 1))]} != '' ]];then - - # In this configuration, the chapter name wasn't specified - # neither in first or second non-option argument. So, we - # perform copying actions on manual directory itself. Notice - # that, in this configuration, the whole manual is duplicated. - texinfo_copyEntryManual - - # In this configuration, there is no need to update section - # menus, nodes and cross references. The section definition - # files were copied from the source manual with any change so - # the manual should build without any problem. Be sure such - # verification will never happen. - - else - cli_printMessage "`gettext "The parameters you provided are not supported."`" --as-error-line - fi - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_copyEntryChapter.sh b/Automation/Modules/Help/Texinfo/texinfo_copyEntryChapter.sh deleted file mode 100755 index 191be20..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_copyEntryChapter.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash -# -# texinfo_copyEntryChapter.sh -- This function standardizes chapter -# duplication inside manuals written in texinfo format. -# -# Copyright (C) 2009-2013 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_copyEntryChapter { - - # Redefine documentation entry source's location. - MANUAL_ENTRY_SRC=${MANUAL_BASEDIR_L10N}/${MANUAL_CHAP[${MANUAL_DOCENTRY_ID}]} - - # Redefine documentation entry target's location. - MANUAL_ENTRY_DST=${MANUAL_BASEDIR_L10N}/${MANUAL_CHAP[((${MANUAL_DOCENTRY_ID} + 1))]} - - # Verify entry source and target locations. - texinfo_checkEntrySrcDst "${MANUAL_ENTRY_SRC}" "${MANUAL_ENTRY_DST}" - - # When we are copying chapters, document structure actualization - # needs to be performed against the target chapter not the source - # one used to create the duplication. To achieve this goal, - # define both chapter's directory and chapter's name at this - # point. - local MANUAL_CHAPTER_DIR=$MANUAL_ENTRY_DST - local MANUAL_CHAPTER_NAME=${MANUAL_CHAP[((${MANUAL_DOCENTRY_ID} + 1))]} - - # When we are copying chapters, the chapter itself cannot be - # copied as we regularly do with sections. Instead, the target - # chapter must be created as a new chapter and then sections from - # source chapter must be copied one by one to the recently created - # chapter. At this point then, is when menu, nodes and cross - # references for the new chapter are updated. - texinfo_createChapter - - # Create list of sections from source chapter that need to be - # copied to target chapter. Don't include chapter's main - # definition files. - local MANUAL_ENTRIES=$(cli_getFilesList $MANUAL_ENTRY_SRC \ - --pattern="^.+\.${MANUAL_EXTENSION}$" | egrep -v '/chapter') - - for MANUAL_ENTRY in $MANUAL_ENTRIES;do - - # Copy sections from source chapter to target chapter. - cli_runFnEnvironment vcs --copy $MANUAL_ENTRY $MANUAL_ENTRY_DST - - # Update section menu, nodes and cross reference definitions - # to all sections inside the documentation manual. - texinfo_updateStructureSection "${MANUAL_ENTRY_DST}/$(basename ${MANUAL_ENTRY})" - - done - - # Update chapter menu and node definitions inside the manual - # structure. - texinfo_updateChapterMenu - texinfo_updateChapterNodes - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_copyEntryManual.sh b/Automation/Modules/Help/Texinfo/texinfo_copyEntryManual.sh deleted file mode 100755 index 423b4b9..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_copyEntryManual.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash -# -# texinfo_copyEntryChapter.sh -- This function standardizes -# duplication of manuals written in texinfo format. -# -# Copyright (C) 2009-2013 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_copyEntryManual { - - # Define list of chapters inside source manual excluding those - # created from template, rendition output and subversion. - local MANUAL_CHAPTER='' - local MANUAL_CHAPTERS=$(cli_getFilesList ${MANUAL_BASEDIR_L10N} \ - --maxdepth=1 --mindepth=1 --type="d" --pattern='^.+$' \ - | egrep -v "(Licenses|\.svn)") - - # Redefine manual name using manual name passed to `centos-art.sh' - # script as second non-option argument. - local MANUAL_NAME=${MANUAL_SLFN[((${MANUAL_DOCENTRY_ID} + 1))]} - - # Redefine absolute path to manual directory using manual name - # passed to `centos-art.sh' script as second non-option argument. - local MANUAL_BASEDIR="$(echo $MANUAL_BASEDIR \ - | sed -r "s!${MANUAL_DIRN[${MANUAL_DOCENTRY_ID}]}!${MANUAL_DIRN[((${MANUAL_DOCENTRY_ID} + 1))]}!")" - - # Redefine absolute path to manual directory using manual name - # passed to `centos-art.sh' script as second non-option argument. - local MANUAL_BASEDIR_L10N="${MANUAL_BASEDIR}/${MANUAL_L10N}" - - # Redefine absolute path to base file using manual name passed to - # `centos-art.sh' script as second non-option argument. - local MANUAL_BASEFILE="${MANUAL_BASEDIR_L10N}/${MANUAL_NAME}" - - # Create manual structure - texinfo_createStructure - - # Loop through list of chapters. - for MANUAL_CHAPTER in ${MANUAL_CHAPTERS};do - - # Print action name. - cli_printMessage "${MANUAL_BASEDIR_L10N}" --as-creating-line - - # Copy chapter directory from source to target using - # subversion. - cli_runFnEnvironment vcs --copy ${MANUAL_CHAPTER} ${MANUAL_BASEDIR_L10N} - - # Define manual chapter name. - local MANUAL_CHAPTER_NAME=$(basename ${MANUAL_CHAPTER}) - - # Update chapter information inside the manual's texinfo - # structure. - texinfo_updateChapterMenu - texinfo_updateChapterNodes - - done - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_copyEntrySection.sh b/Automation/Modules/Help/Texinfo/texinfo_copyEntrySection.sh deleted file mode 100755 index 1698dcc..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_copyEntrySection.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/bash -# -# texinfo_copyEntrySection.sh -- This function standardizes section -# duplication inside manuals written in texinfo format. -# -# Copyright (C) 2009-2013 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_copyEntrySection { - - # Define absolute path to section source and target locations - # based on non-option arguments passed to `centos-art.sh' script. - if [[ ${MANUAL_SECT[((${MANUAL_DOCENTRY_ID} + 1))]} != '' ]];then - - # When the section name is specified in first and second - # non-option arguments, source and target are set as specified - # in first and second non-option arguments respectively. - MANUAL_ENTRY_SRC=$(texinfo_getEntry ${MANUAL_SECT[${MANUAL_DOCENTRY_ID}]}) - MANUAL_ENTRY_DST=$(texinfo_getEntry ${MANUAL_SECT[((${MANUAL_DOCENTRY_ID} + 1))]}) - - elif [[ ${MANUAL_SECT[((${MANUAL_DOCENTRY_ID} + 1))]} == '' ]] \ - && [[ ${MANUAL_CHAP[((${MANUAL_DOCENTRY_ID} + 1))]} != '' ]];then - - # When the section name is specified only in the first - # non-option argument and the chapter name has been provided - # in the second non-option argument, use the section name - # passed in first argument to build the section name that will - # be used as target. - MANUAL_ENTRY_SRC=$(texinfo_getEntry ${MANUAL_SECT[${MANUAL_DOCENTRY_ID}]}) - MANUAL_ENTRY_DST=$(echo $MANUAL_ENTRY_SRC \ - | sed -r "s!${MANUAL_CHAP[${MANUAL_DOCENTRY_ID}]}!${MANUAL_CHAP[((${MANUAL_DOCENTRY_ID} + 1))]}!") - - else - cli_printMessage "`gettext "The location provided as target isn't valid."`" --as-error-line - fi - - # Print separator line along with action message. - cli_printMessage '-' --as-separator-line - cli_printMessage "${MANUAL_ENTRY_DST}" --as-creating-line - - # Verify entry source and target locations. - texinfo_checkEntrySrcDst "${MANUAL_ENTRY_SRC}" "${MANUAL_ENTRY_DST}" - - # Copy section entry from source to target using subversion. - cli_runFnEnvironment vcs --quiet --copy "${MANUAL_ENTRY_SRC}" "${MANUAL_ENTRY_DST}" - - # Redefine chapter name using chapter name passed to - # `centos-art.sh' script as second non-option argument. - local MANUAL_CHAPTER_NAME=${MANUAL_CHAP[((${MANUAL_DOCENTRY_ID} + 1))]} - - # Redefine chapter directory to use the chapter provided to - # `centos-art.sh' script as second non-option argument. This is - # required in order to update the `chapter-menu.texinfo' file - # inside the target chapter where section entry was copied to, not - # the source chapter where the section entry was taken from. This - # is particularly useful section entries are copied from one - # chapter into another different. - local MANUAL_CHAPTER_DIR=$(dirname ${MANUAL_ENTRY_DST}) - - # At this point, all copying actions and chapter related - # redefinitions have took place. It is time, then, to update the - # document structure using the information collected so far. - texinfo_updateStructureSection "${MANUAL_ENTRY_DST}" - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_createChapter.sh b/Automation/Modules/Help/Texinfo/texinfo_createChapter.sh deleted file mode 100755 index 66cb08e..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_createChapter.sh +++ /dev/null @@ -1,120 +0,0 @@ -#!/bin/bash -# -# texinfo_createChapter.sh -- This function standardizes chapter -# creation insdie the manual structure. -# -# Copyright (C) 2009-2013 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_createChapter { - - # Verify chapter directory inside the manual structure. The - # chapter directory is where chapter-specific information (e.g., - # chapter definition files and sections) are stored in. If this - # directory already exist, assume it was created correctly in the - # past. Otherwise, request confirmation for creating it. - if [[ -d $MANUAL_CHAPTER_DIR ]];then - return - else - cli_printMessage "`gettext "The following documentation chapter doesn't exist:"`" --as-stdout-line - cli_printMessage "${MANUAL_CHAPTER_DIR}.${MANUAL_EXTENSION}" --as-response-line - cli_printMessage "`gettext "Do you want to create it now?"`" --as-yesornorequest-line - fi - - # Initialize chapter node, chapter index and chapter title. - local MANUAL_CHAPTER_NODE='' - local MANUAL_CHAPTER_TITLE='' - local MANUAL_CHAPTER_CIND='' - - # Request the user to enter a chapter title. - cli_printMessage "`gettext "Enter chapter's title"`" --as-request-line - read MANUAL_CHAPTER_TITLE - - # Sanitate chapter node, chapter index and chapter title. - MANUAL_CHAPTER_NODE=$(texinfo_getEntryNode "$MANUAL_CHAPTER_NAME") - MANUAL_CHAPTER_CIND=$(texinfo_getEntryIndex "$MANUAL_CHAPTER_TITLE") - MANUAL_CHAPTER_TITLE=$(texinfo_getEntryTitle "$MANUAL_CHAPTER_TITLE") - - # Define list of template files used to build the chapter main - # definition files. - local FILE='' - local FILES=$(cli_getFilesList "${MANUAL_TEMPLATE_L10N}" \ - --maxdepth='1' \ - --pattern="^.+/Chapters(-menu|-nodes)?\.${MANUAL_EXTENSION}$") - - # Create chapter directory using version control. This is the - # place where all chapter-specific files will be stored in. - if [[ ! -d ${MANUAL_CHAPTER_DIR} ]];then - cli_printMessage "${MANUAL_CHAPTER_DIR}" --as-creating-line - cli_runFnEnvironment vcs --quiet --mkdir ${MANUAL_CHAPTER_DIR} - fi - - # Create chapter-specific files using template files as reference. - for FILE in $FILES;do - - # Verify texinfo templates used as based to build the chapter - # structure. Be sure they are inside the working copy of The - # CentOS Artwork Repository (-w) and under version control - # (-n), too. - cli_checkFiles ${FILE} - - # Redefine the chapter file using the correct name. - local MANUAL_CHAPTER_FILE=${MANUAL_CHAPTER_DIR}$(basename ${FILE} \ - | sed -r 's,Chapters,,') - - # Print action name. - cli_printMessage "${MANUAL_CHAPTER_FILE}" --as-creating-line - - # Copy template files into the chapter directory. - cli_runFnEnvironment vcs --quiet --copy ${FILE} ${MANUAL_CHAPTER_FILE} - - done - - # Before expanding chapter information, be sure the slash (/) - # character be escaped. Otherwise, if the slashes aren't scape, - # they will be interpreted as sed's separator and might provoke - # sed to complain. - MANUAL_CHAPTER_NODE=$(echo "$MANUAL_CHAPTER_NODE" | sed -r 's/\//\\\//g') - MANUAL_CHAPTER_CIND=$(echo "$MANUAL_CHAPTER_CIND" | sed -r 's/\//\\\//g') - MANUAL_CHAPTER_TITLE=$(echo "$MANUAL_CHAPTER_TITLE" | sed -r 's/\//\\\//g') - MANUAL_CHAPTER_NAME=$(echo "$MANUAL_CHAPTER_NAME" | sed -r 's/\//\\\//g') - - # Expand translation markers inside chapter main definition file. - sed -i -r \ - -e "s/=CHAPTER_NODE=/${MANUAL_CHAPTER_NODE}/" \ - -e "s/=CHAPTER_TITLE=/${MANUAL_CHAPTER_TITLE}/" \ - -e "s/=CHAPTER_CIND=/${MANUAL_CHAPTER_CIND}/" \ - -e "s/=CHAPTER_NAME=/${MANUAL_CHAPTER_NAME}/" \ - ${MANUAL_CHAPTER_DIR}.${MANUAL_EXTENSION} - - # Remove content from `chapter-nodes.texinfo' file to start with a - # clean node structure. This file is also used to create new - # documentation entries, but we don't need that information right - # now (when the chapter structure is created), just an empty copy - # of the file. The node structure of chapter is created - # automatically based on action value. - echo "" > ${MANUAL_CHAPTER_DIR}-nodes.${MANUAL_EXTENSION} - - # Update chapter information inside the manual's texinfo - # structure. - texinfo_updateChapterMenu - texinfo_updateChapterNodes - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_createStructure.sh b/Automation/Modules/Help/Texinfo/texinfo_createStructure.sh deleted file mode 100755 index 6338aa3..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_createStructure.sh +++ /dev/null @@ -1,118 +0,0 @@ -#!/bin/bash -# -# texinfo_createStructure.sh -- This function creates the -# documentation structure of a manual using the current language as -# reference. -# -# Copyright (C) 2009-2013 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_createStructure { - - # Verify manual main definition file. If it already exist, assume - # it was correctly created in the past. Otherwise try to create - # it. Don't use the manual base directory here, it would prevent - # documentation manuals from being created on different languages. - if [[ -f ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} ]];then - return - else - cli_printMessage "`eval_gettext "The following documentation manual doesn't exist:"`" --as-stdout-line - cli_printMessage "${MANUAL_BASEFILE}.${MANUAL_EXTENSION}" --as-response-line - cli_printMessage "`gettext "Do you want to create it now?"`" --as-yesornorequest-line - fi - - # Initialize manual's information (e.g., title, subtitle, abstract). - local MANUAL_TITLE='' - local MANUAL_SUBTITLE='' - local MANUAL_ABSTRACT='' - - # Retrieve manual's information from standard input. - cli_printMessage "`gettext "Enter manual's title"`" --as-request-line - read MANUAL_TITLE - cli_printMessage "`gettext "Enter manual's subtitle"`" --as-request-line - read MANUAL_SUBTITLE - cli_printMessage "`gettext "Enter manual's abstract"`" --as-request-line - read MANUAL_ABSTRACT - - # Verify manual's information. The title information must be - # non-empty value. - if [[ $MANUAL_TITLE == '' ]];then - cli_printMessage "`gettext "The manual title cannot be empty."`" --as-error-line - fi - - # Create manual's top-level directory using default version - # control system. This is the place where all texinfo - # documentation manuals are stored in. - if [[ ! -d ${MANUAL_BASEDIR} ]];then - cli_printMessage "${MANUAL_BASEDIR}" --as-creating-line - cli_runFnEnvironment vcs --quiet --mkdir ${MANUAL_BASEDIR} - fi - - # Create manual's base directory. This is the place where - # language-specific documentation source files are stored in. - cli_printMessage "${MANUAL_BASEDIR_L10N}" --as-creating-line - cli_runFnEnvironment vcs --quiet --mkdir ${MANUAL_BASEDIR_L10N} - - # Define file names required to build the manual. - local FILE='' - local FILES=$(cli_getFilesList "${MANUAL_TEMPLATE_L10N}" \ - --maxdepth='1' \ - --pattern="^.+/manual((-menu|-nodes|-index)?\.${MANUAL_EXTENSION}|\.conf)$") - - # Verify manual base file. The manual base file is where the - # documentation manual is defined in the format format. Assuming - # no file exists (e.g., a new language-specific manual is being - # created), use texinfo templates for it. - for FILE in $FILES;do - if [[ ! -f ${MANUAL_BASEDIR_L10N}/$(basename ${FILE}) ]];then - - # Be sure the file is inside the working copy and under - # version control. - cli_checkFiles ${FILE} --is-versioned - - # Define target file. - local DST=${MANUAL_BASEDIR_L10N}/$(basename ${FILE} \ - | sed -r "s!manual!${MANUAL_NAME}!") - - # Print action name. - cli_printMessage "${DST}" --as-creating-line - - # Copy using subversion to register this action. - cli_runFnEnvironment vcs --quiet --copy ${FILE} ${DST} - - # Expand common translation markers inside target file. - cli_expandTMarkers ${DST} - - # Expand specific translation markers inside target file. - sed -r -i -e "s!=MANUAL_NAME=!${MANUAL_NAME}!g" \ - -e "s!=MANUAL_TITLE=!${MANUAL_TITLE}!g" \ - -e "s!=MANUAL_SUBTITLE=!${MANUAL_SUBTITLE}!g" \ - -e "s!=MANUAL_ABSTRACT=!${MANUAL_ABSTRACT}!g" $DST - - fi - done - - # Initialize chapter structure inside the manual. - texinfo_createStructureChapters - - # Redefine absolute path to changed directory. - MANUAL_CHANGED_DIRS=${MANUAL_BASEDIR} - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_createStructureChapters.sh b/Automation/Modules/Help/Texinfo/texinfo_createStructureChapters.sh deleted file mode 100755 index 8356255..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_createStructureChapters.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash -# -# texinfo_createStructureChapters.sh -- This function initiates the -# chapter documentation structure of a manual, using the current -# language and template files as reference. -# -# Copyright (C) 2009-2013 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_createStructureChapters { - - local MANUAL_CHAPTER_DIR='' - - # Define list of chapter templates files used to build the - # documentation manual. Do not include the `Chapters' and - # `Licenses' directory here. The Chapters directory is used to - # build chapters based on value of `--chapter' option passed - # through the command-line. The `Licenses' directory is linked - # from its default template directory. - local FILE='' - local FILES=$(cli_getFilesList ${MANUAL_TEMPLATE_L10N} \ - --pattern="^.+/Chapters(-menu|-nodes)?\.${MANUAL_EXTENSION}$" --mindepth='1' \ - | egrep -v '/(Chapters|Licenses)/') - - # Loop through chapter structures and create them inside the - # manual. - for FILE in $FILES;do - - # Redefine manual's chapter directory based on template files. - MANUAL_CHAPTER_DIR=${MANUAL_BASEDIR_L10N}/$(basename $(dirname ${FILE})) - - # Verify texinfo templates used as based to build the chapter. - # Be sure they are inside the working copy of CentOS Artwork - # Repository and under version control, too. - cli_checkFiles ${FILE} --is-versioned - - # Print action name. - cli_printMessage "${MANUAL_CHAPTER_DIR}/$(basename ${FILE})" --as-creating-line - - # Verify chapter's directory. If it doesn't exist, create it. - if [[ ! -d ${MANUAL_CHAPTER_DIR} ]];then - cli_runFnEnvironment vcs --quiet --mkdir ${MANUAL_CHAPTER_DIR} - fi - - # Copy template files into chapter's directory. - cli_runFnEnvironment vcs --quiet --copy ${FILE} ${MANUAL_CHAPTER_DIR} - - done - - # Create link to `Licenses' default template directory. There - # isn't a need to duplicate this information. In fact it is - # important not to have it duplicated so we can centralize such - # information for all documentation manuals. - texinfo_updateLicenseLink - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_deleteCrossReferences.sh b/Automation/Modules/Help/Texinfo/texinfo_deleteCrossReferences.sh deleted file mode 100755 index 0793e56..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_deleteCrossReferences.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/bash -# -# texinfo_deleteCrossReferences.sh -- This function looks inside -# texinfo source files, from section level on, and removes all cross -# reference definitions related to a documentation entry. Use this -# function in coordination with texinfo_deleteEntry function, in order -# to keep cross reference information, inside the documentation -# manual, synchronized. -# -# Copyright (C) 2009-2013 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_deleteCrossReferences { - - local -a PATTERN - local -a REPLACE - - # Define documentation entry. - local MANUAL_ENTRY="$1" - - # Verify documentation entry. If documentation entry is empty, - # stop script execution with an error message. - if [[ $MANUAL_ENTRY == '' ]];then - cli_printMessage "`gettext "The first positional parameter cannot be empty."`" --as-error-line - fi - - # Build the node string using entry location. - local NODE="$(texinfo_getEntryNode "$MANUAL_ENTRY")" - - # Define regular expression patterns for texinfo cross reference - # commands. - PATTERN[0]="@(pxref|xref|ref)\{(${NODE})\}" - REPLACE[0]='--- @strong{'`gettext "Removed"`'}(\1:\2) ---' - - # Define replacement string for missing entries. It is convenient - # to keep missing entries in documentation for documentation team - # to know. Removing the missing cross reference may introduce - # confusion. Imagine that you are spending lots of hours in an - # article and suddenly one of your cross references disappears - # with no visible reason, with the next working copy update you - # perform. That's frustrating. Instead, when centos-art.sh script - # finds a missing cross reference it removes the link and remark - # the issue for you to act on it. - PATTERN[1]="^(\* ${NODE}:(.*):(.*))$" - REPLACE[1]='\@comment --- '`gettext "Removed"`'(\1) ---' - - # Define list of entries to process. - local MANUAL_ENTRIES=$(cli_getFilesList ${MANUAL_BASEDIR_L10N} \ - --pattern="^.+\.${MANUAL_EXTENSION}$" \ - | egrep -v "(${MANUAL_NAME}|chapter)-(menu|nodes|index)") - - # Update node-related cross references. The node-related cross - # reference definition, long ones specially, could require more - # than one line to be set. By default, GNU sed does not matches - # newline characters in the pattern space, so we need to make use - # of `label' feature and the `N' command in order to build a - # pattern space that includes the newline character in it. Here we - # use the `a' letter to name the label we use, followed by N - # command to add a newline to the pattern space, the s command to - # make the pattern replacement using the `g' flag to make it - # global and finally the command `b' to branch label named `a'. - sed -r -i ":a;N;s!${PATTERN[0]}!${REPLACE[0]}!g;ba" ${MANUAL_ENTRIES} - - # Update menu-related cross references. Menu-related cross - # references hardly appear in more than one line, so there is no - # need to complicate much the replacement command. - sed -r -i "s!${PATTERN[1]}!${REPLACE[1]}!" ${MANUAL_ENTRIES} - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_deleteEntry.sh b/Automation/Modules/Help/Texinfo/texinfo_deleteEntry.sh deleted file mode 100755 index b700804..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_deleteEntry.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash -# -# texinfo_deleteEntry.sh -- This function removes a documentation -# manuals, chapters or sections from the working copy. -# -# Copyright (C) 2009-2013 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_deleteEntry { - - # Remove manual, chapter or section based on documentation entry - # provided as non-option argument to `centos-art.sh' script. - if [[ ${MANUAL_SECT[$MANUAL_DOCENTRY_ID]} != '' ]];then - - # When a section is deleted, documentation entry points to a - # section name. In this configuration, documentation entry is - # deleted through subversion in order to register the change. - # Once the documentation entry is deleted, the section menu - # and nodes definition files are updated to keep manual in a - # consistent state. - texinfo_deleteEntrySection - - elif [[ ${MANUAL_CHAP[$MANUAL_DOCENTRY_ID]} != '' ]];then - - # When a chapter is deleted, documentation entry doesn't point - # to a section name but a chapter name. In this configuration, - # it is necessary to build a list of all the section entries - # available inside the chapter before deleting it. Once the - # chapter has been marked for deletion, it is time to update - # chapter definition files and later section definition files - # using the list of section entries previously defined. - # Actualization of section definition files must be done one - # at a time because menu entries related to section - # definitions are updated one at a time. - texinfo_deleteEntryChapter - - elif [[ ${MANUAL_DIRN[$MANUAL_DOCENTRY_ID]} != '' ]];then - - # When a manual is deleted, documentation entry doesnt' point - # to either a section or chapter but a manual name only. In - # this configuration the entire manual directory is marked for - # deletion, and that way processed. - texinfo_deleteEntryManual - - else - cli_printMessage "`gettext "The parameters you provided are not supported."`" --as-error-line - fi - - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_deleteEntryChapter.sh b/Automation/Modules/Help/Texinfo/texinfo_deleteEntryChapter.sh deleted file mode 100755 index 6cc2350..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_deleteEntryChapter.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash -# -# texinfo_deleteEntryChapter.sh -- This function standardizes chapter -# deletion inside the manual structure. -# -# Copyright (C) 2009-2013 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_deleteEntryChapter { - - # Verify existence of documentation entry before deleting it. - # We cannot delete an entry which doesn't exist. - cli_checkFiles "${MANUAL_CHAPTER_DIR}" -d - cli_checkFiles "${MANUAL_CHAPTER_DIR}-menu.${MANUAL_EXTENSION}" -f - cli_checkFiles "${MANUAL_CHAPTER_DIR}-nodes.${MANUAL_EXTENSION}" -f - cli_checkFiles "${MANUAL_CHAPTER_DIR}.${MANUAL_EXTENSION}" -f - - # Define list of chapters that shouldn't be removed. - local SPECIAL_CHAPTERS='/(Licenses|Index)$' - - # Verify list of chapters that shouldn't be removed against the - # current chapter directory being removed. - if [[ $MANUAL_CHAPTER_DIR =~ $SPECIAL_CHAPTERS ]];then - cli_printMessage "`gettext "The chapter specified cannot be removed."`" --as-error-line - fi - - # Build list of section entries inside the chapter. This is - # required to delete cross references from other section entries - # that point to section entries inside the chapter that will be - # deleted. Take care don't include the chapter definition files. - local MANUAL_ENTRIES=$(cli_getFilesList $MANUAL_CHAPTER_DIR \ - --pattern="^/.+\.${MANUAL_EXTENSION}$") - - # Remove chapter directory and related files using version control - # to register the change. - cli_runFnEnvironment vcs --delete ${MANUAL_CHAPTER_DIR} - cli_runFnEnvironment vcs --delete ${MANUAL_CHAPTER_DIR}-menu.${MANUAL_EXTENSION} - cli_runFnEnvironment vcs --delete ${MANUAL_CHAPTER_DIR}-nodes.${MANUAL_EXTENSION} - cli_runFnEnvironment vcs --delete ${MANUAL_CHAPTER_DIR}.${MANUAL_EXTENSION} - - # Update chapter menu and nodes inside manual structure. - texinfo_updateChapterMenu --delete-entry - texinfo_updateChapterNodes - - # Loop through section entries retrieved from chapter, before - # deleting it, in order to remove cross references pointing to - # those section entries. Since the chapter and all its sections - # have been removed, cross references pointing them will point to - # non-existent section entries. This way, all cross references - # pointing to non-existent section entries will be transformed in - # order for documenters to advertise the section entry state. - for MANUAL_ENTRY in $MANUAL_ENTRIES;do - texinfo_deleteCrossReferences ${MANUAL_ENTRY} - done - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_deleteEntryManual.sh b/Automation/Modules/Help/Texinfo/texinfo_deleteEntryManual.sh deleted file mode 100755 index 84d2bad..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_deleteEntryManual.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash -# -# texinfo_deleteEntryManual.sh -- This function standardized manual -# deletion inside the working copy. -# -# Copyright (C) 2009-2013 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_deleteEntryManual { - - # Verify existence of documentation entry before deleting it. We - # cannot delete an entry which doesn't exist. - cli_checkFiles "$MANUAL_ENTRY" -f - - # Remove locale-specific documentation manual directory from the - # working copy. Using subversion to register the change. Be sure - # that related output files are removed too. - cli_runFnEnvironment vcs --quiet --delete ${MANUAL_BASEDIR_L10N} - - # Verify manual base directory. When the locale-specific - # documentation manual is the last one inside the manual base - # directory, remove the manual base directory from the working - # copy. There is no need to have an empty manual base directories - # inside the working copy. - if [[ $(ls -1 $MANUAL_BASEDIR | wc -l) -le 1 ]];then - - # Remove manual base directory. - cli_runFnEnvironment vcs --delete ${MANUAL_BASEDIR} - - # Redefine absolute paths to changed directory. This is - # required in order for `(git|subversion)_commitRepoChanges' - # to be aware that we are deleting MANUAL_BASEDIR, not - # MANUAL_BASEDIR_L10N. - MANUAL_CHANGED_DIRS="${MANUAL_BASEDIR}" - - fi - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_deleteEntrySection.sh b/Automation/Modules/Help/Texinfo/texinfo_deleteEntrySection.sh deleted file mode 100755 index cc96ba4..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_deleteEntrySection.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -# -# texinfo_deleteEntrySection.sh -- This function standardized section -# deletion inside the manual structure. -# -# Copyright (C) 2009-2013 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_deleteEntrySection { - - # Verify documentation entry existence. We cannot remove a - # documentation entry which doesn't exist. - cli_checkFiles ${MANUAL_ENTRY} -f - - # Remove documentation entry using subversion to register the - # change. - cli_runFnEnvironment vcs --delete "${MANUAL_ENTRY}" - - # Update section menu, nodes and cross references. - texinfo_updateStructureSection "${MANUAL_ENTRY}" --delete - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_editEntry.sh b/Automation/Modules/Help/Texinfo/texinfo_editEntry.sh deleted file mode 100755 index 6acce79..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_editEntry.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/bash -# -# texinfo_editEntry.sh -- This function implements the edition flow of -# documentation entries inside the working copy. -# -# Copyright (C) 2009-2013 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_editEntry { - - # Verify section definition inside chapters. - if [[ ! -f $MANUAL_ENTRY ]];then - - # Verify chapter related to documentation entry. Inside - # manuals, all documentation entries are stored directly under - # its chapter directory. There is no more levels deep so it is - # possible to perform a direct chapter verification here. - if [[ ! -a $(dirname $MANUAL_ENTRY).${MANUAL_EXTENSION} ]];then - texinfo_createChapter - fi - - # Print confirmation question. - cli_printMessage "`gettext "The following documentation section doesn't exist:"`" --as-stdout-line - cli_printMessage "$MANUAL_ENTRY" --as-response-line - cli_printMessage "`gettext "Do you want to create it now?"`" --as-yesornorequest-line - - # Print action message. - cli_printMessage "$MANUAL_ENTRY" --as-updating-line - - # Update section menu, nodes and cross references based on - # changes in order for manual structure to remain consistent. - texinfo_updateStructureSection "$MANUAL_ENTRY" - - # Use default text editor to write changes on documentation entry. - $EDITOR $MANUAL_ENTRY - - else - - # Print action message. - cli_printMessage "$MANUAL_ENTRY" --as-updating-line - - # Rebuild section menu definitions before editing the - # documentation entry. This way, if there is any change in the - # section menu definition, it will be visible to you on - # edition. - texinfo_makeSeeAlso "$MANUAL_ENTRY" - - # Use default text editor to write changes on documentation entry. - $EDITOR $MANUAL_ENTRY - - # Rebuild section menu definitions after editing the - # documentation entry. This way, if there is any change or - # expansion to realize in the section menu definition, it be - # applied right now. Don't see a reason for waiting until the - # next edition for expansions to happen. - texinfo_makeSeeAlso "$MANUAL_ENTRY" - - fi - - # Rebuild output files to propagate recent changes, if any. - texinfo_updateOutputFiles - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_getEntry.sh b/Automation/Modules/Help/Texinfo/texinfo_getEntry.sh deleted file mode 100755 index 00b2f97..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_getEntry.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -# -# texinfo_getEntry.sh -- This function builds a documentation entry -# based on location specified as first positional parameter. -# -# Copyright (C) 2009-2013 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_getEntry { - - local MANUAL_ENTRY='' - local MANUAL_SECTION_NAME='' - local MANUAL_SECTION_NAMES="$@" - - # Loop through list of section names. - for MANUAL_SECTION_NAME in $MANUAL_SECTION_NAMES;do - - # Define absolute path to documentation entry. - MANUAL_ENTRY=${MANUAL_BASEDIR_L10N}/${MANUAL_CHAPTER_NAME}/${MANUAL_SECTION_NAME}.${MANUAL_EXTENSION} - - # Output entry's absolute path. - echo ${MANUAL_ENTRY} - - done - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_getEntryIndex.sh b/Automation/Modules/Help/Texinfo/texinfo_getEntryIndex.sh deleted file mode 100755 index cc93ce4..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_getEntryIndex.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -# -# texinfo_getEntryTitle.sh -- This function standardizes the way -# values for chapter and section index definitions are printed out. -# -# Copyright (C) 2009-2013 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_getEntryIndex { - - # Initialize phrase we want to transform based on style provided. - local PHRASE="$1" - - # In the entire phrase provided, capitalize the first word only. - PHRASE=$(echo "${PHRASE}" | tr '[:upper:]' '[:lower:]' \ - | sed -r 's!^([[:alpha:]])!\u\1!') - - # Output transformed phrase. - echo "$PHRASE" - -} - diff --git a/Automation/Modules/Help/Texinfo/texinfo_getEntryNode.sh b/Automation/Modules/Help/Texinfo/texinfo_getEntryNode.sh deleted file mode 100755 index 801061b..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_getEntryNode.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -# -# texinfo_getEntryNode.sh -- This function cleans up the action value -# (ACTIONVAL) directory to make a node name from it. -# -# Copyright (C) 2009-2013 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_getEntryNode { - - # Define documentation entry. - local MANUAL_ENTRY="$1" - - # Verify documentation entry. - if [[ $MANUAL_ENTRY == '' ]];then - cli_printMessage "`gettext "The first positional parameter cannot be empty."`" --as-error-line - fi - - # Define node from documentation entry. - local NODE=$(echo "$MANUAL_ENTRY" | sed -r \ - -e "s!^${MANUAL_BASEDIR_L10N}/!!" \ - -e "s/\.${MANUAL_EXTENSION}$//" \ - -e "s!chapter!!" \ - -e 's!(/|-)! !g' \ - -e 's!\<([[:alpha:]]+)\>!\u\1!g' \ - -e 's!^[[:space:]]+!!' \ - -e 's![[:space:]]+$!!') - - echo "$NODE" - -} - diff --git a/Automation/Modules/Help/Texinfo/texinfo_getEntryTitle.sh b/Automation/Modules/Help/Texinfo/texinfo_getEntryTitle.sh deleted file mode 100755 index ce305c3..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_getEntryTitle.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/bash -# -# texinfo_getEntryTitle.sh -- This function standardizes the way entry -# titles for chapters and sections are printed out. -# -# Copyright (C) 2009-2013 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_getEntryTitle { - - # Initialize phrase we want to transform based on style provided. - local PHRASE="$1" - - # Define section style. Through this property you can customize - # the section title in predefined ways. By default, section - # titles are printed with each word capitalized (`cap-each-word'). - # Other values to this option are `cap-first-only' (to capitalize - # just the first word in the title) or `directory' to transform - # each word to a directory path. - local MANUAL_SECTION_STYLE=$(cli_getConfigValue "${MANUAL_CONFIG_FILE}" "main" "manual_section_style") - if [[ ! $MANUAL_SECTION_STYLE =~ '^(cap-each-word|cap-first-only|directory)$' ]];then - MANUAL_SECTION_STYLE='cap-each-word' - fi - - # Verify section style provided and transform the phrase value in - # accordance with it. - case $MANUAL_SECTION_STYLE in - - 'cap-first-only' ) - - # In the entire phrase provided, capitalize the first word - # only. - PHRASE=$(echo "${PHRASE}" | tr '[:upper:]' '[:lower:]' \ - | sed -r 's!^([[:alpha:]])!\u\1!') - ;; - - 'directory' ) - - # In the entire phrase provided, concatenate all words - # with slash (/) character and remark the fact it is a - # directory. - PHRASE=$(echo "${PHRASE}" | sed -r \ - -e 's/(Trunk|Branches|Tags)/\l\1/' \ - -e 's/ /\//g' \ - -e 's/\/([[:alpha:]])/\/\u\1/g') - - PHRASE="@file{$PHRASE}" - ;; - - 'cap-each-word' | * ) - - # In the entire phrase provided, capitalize all words. - PHRASE=$(echo "${PHRASE}" | tr '[:upper:]' '[:lower:]' \ - | sed -r 's!\<([[:alpha:]]+)\>!\u\1!g') - ;; - - esac - - # Output transformed phrase. - echo "$PHRASE" - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_makeSeeAlso.sh b/Automation/Modules/Help/Texinfo/texinfo_makeSeeAlso.sh deleted file mode 100755 index 346527d..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_makeSeeAlso.sh +++ /dev/null @@ -1,149 +0,0 @@ -#!/bin/bash -# -# texinfo_makeSeeAlso.sh -- This function creates a list of links with -# section entries one level ahead from the current section entry being -# processed. Desition of what of these texinfo definitions to use is -# set inside the section entry itself, through the following -# construction: -# -# @c -- <[centos-art(SeeAlso,TYPE) -# @c -- ]> -# -# In this construction, the TYPE variable can be either `itemize', -# `enumerate' or `menu'. -# -# Copyright (C) 2009-2013 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_makeSeeAlso { - - # Initialize variables. - local CHILD_ENTRIES='' - local CHILD_ENTRY='' - local ENTRY_PATTERN='' - local LIST_DEF='' - local LIST_ENTRIES='' - local LIST_TYPE='' - local LIST_TYPE_PATTERN='' - local MANUAL_ENTRY='' - local TMARK='' - local TMARK_PATTERN='' - local TMARKS='' - - # Define absolute path to section entry. - MANUAL_ENTRY="$1" - - # Verify section entry. When section entries are deleted, there is - # no menu definition to set. - if [[ ! -f $MANUAL_ENTRY ]];then - return - fi - - # Define `SeeAlso' translation marker regular expression pattern. - TMARK_PATTERN="^@c -- <\[${CLI_NAME}\(SeeAlso(,(itemize|enumerate|menu))?\)$" - - # Retrieve `SeeAlso' translation marker definition lines. Be sure - # to retrieve unique definitions only. If the same definition is - # present more than once, it will be expanded in one pass. There's - # no need to go through different passes in order to expand - # repeated translation marker definition. - TMARKS=$(egrep "${TMARK_PATTERN}" $MANUAL_ENTRY | sort | uniq) - - # Remove spaces from translation marker definition lines in order - # to process them correctly. Otherwise the definition line would - # be broken on each space character and then that wouldn't be the - # definition line we initially conceived. - TMARKS=$(echo "$TMARKS" | sed -r 's/ /\\040/g') - - # Define pattern used to build list of child sections. A child - # section shares the same path information of its parent without - # file extension. For example, if you have the `identity', - # `identity-images' and `identity-images-themes' section entries, - # `identity-images' is a child entry of `identity' likewise - # `identity-images-themes' is a child entry of `identity-images'. - ENTRY_PATTERN=$(echo "$MANUAL_ENTRY" | sed -r "s/\.${MANUAL_EXTENSION}$//") - - # Define list of child entries we'll use as reference to build the - # menu nodes. Reverse the output here to produce the correct value - # based on menu nodes definition set further. - CHILD_ENTRIES=$(cli_getFilesList $(dirname ${MANUAL_ENTRY}) \ - --pattern="^${ENTRY_PATTERN}-[[:alnum:]]+\.${MANUAL_EXTENSION}$" | sort -r | uniq ) - - # Loop through translation marker definition lines. - for TMARK in $TMARKS;do - - # Define list type based on translation marker definition. - # Remember to revert back the space character transformation - # we previously did, in order for the translation marker - # regular expression pattern to match. - LIST_TYPE=$(echo "$TMARK" | sed -r -e 's/\\040/ /g' -e "s/${TMARK_PATTERN}/\2/") - - # Define list type default value. This is, the list type used - # when no list type is specified in the translation marker - # construction properties field. - if [[ $LIST_TYPE == '' ]];then - LIST_TYPE="itemize" - fi - - # Define list properties (type included). - LIST_PROP=$(echo "$TMARK" | sed -r -e 's/\\040/ /g' -e "s/${TMARK_PATTERN}/\1/") - - # Define `SeeAlso' translation marker regular expression - # pattern that matches the translation marker definition. - # Notice that we cannot use TMARK_PATTERN here because it - # includes a selection list of all possible translation - # markers that can provided and here we need to precisely set - # the one being currently processed, not those whose could be - # processed. - LIST_TYPE_PATTERN="^@c -- <\[${CLI_NAME}\(SeeAlso${LIST_PROP}\)$" - - # Redefine list's entry based on translation marker definition. - if [[ $LIST_TYPE =~ '^menu$' ]];then - for CHILD_ENTRY in $CHILD_ENTRIES;do - LIST_ENTRIES="* $(texinfo_getEntryNode "$CHILD_ENTRY")::\n${LIST_ENTRIES}" - done - elif [[ $LIST_TYPE =~ '^(itemize|enumerate)$' ]];then - for CHILD_ENTRY in $CHILD_ENTRIES;do - LIST_ENTRIES="@item @ref{$(texinfo_getEntryNode "$CHILD_ENTRY")}\n${LIST_ENTRIES}" - done - else - # When an translation marker isn't recognize, go on with - # the next one in the list. - continue - fi - - # Define menu using menu nodes. - LIST_DEF="@c -- <[${CLI_NAME}(SeeAlso${LIST_PROP})\n@${LIST_TYPE}\n${LIST_ENTRIES}@end ${LIST_TYPE}\n@c -- ]>" - - # Expand list definition using translation marker and list - # definition itself. Be sure that no expansion be done when - # the closing tag of translation marker isn't specified. - # Otherwise, there might be lost of content. - sed -r -i "/${LIST_TYPE_PATTERN}/{:a;N;/\n@c -- ]>$/!ba;s/.*/${LIST_DEF}/;}" $MANUAL_ENTRY - - # Clean up both list definition and list entries. Otherwise - # undesired concatenations happen. - LIST_DEF='' - LIST_ENTRIES='' - LIST_TYPE='' - - done - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_renameCrossReferences.sh b/Automation/Modules/Help/Texinfo/texinfo_renameCrossReferences.sh deleted file mode 100755 index 597ae59..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_renameCrossReferences.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash -# -# texinfo_renameCrossReferences.sh -- This function renames menu, -# nodes and cross references related to chapters and sections that -# have been renamed previously. -# -# Copyright (C) 2009-2013 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_renameCrossReferences { - - local -a PATTERN - local -a REPLACE - - # Build source and target node definitions. - local NODE_SRC="$(texinfo_getEntryNode "$MANUAL_ENTRY_SRC")" - local NODE_DST="$(texinfo_getEntryNode "$MANUAL_ENTRY_DST")" - - # Define regular expression pattern and its replacement for node - # definitions that have been previously removed. - PATTERN[0]="--- @strong\{`gettext "Removed"`\}\((pxref|xref|ref):\<${NODE_SRC}\>(.*)\) ---" - REPLACE[0]="\@\1{${NODE_DST}\2}" - - # Define regular expression pattern and its replacement for menu - # definitions that have been previously removed. - PATTERN[1]="^@comment --- `gettext "Removed"`\(\* \<${NODE_SRC}\>(.*)\) ---$" - REPLACE[1]="* ${NODE_DST}\1" - - # Define list of entries to process. This is, all the texinfo - # source files the documentation manual is made of. - local MANUAL_ENTRIES=$(cli_getFilesList ${MANUAL_BASEDIR_L10N} \ - --pattern="^.+\.${MANUAL_EXTENSION}$" \ - | egrep -v "(${MANUAL_NAME}|chapter)-(menu|nodes|index)") - - # Update node cross references. The node-related cross reference - # definition, long ones specially, could require more than one - # line to be set. By default, GNU sed does not matches newline - # characters in the pattern space, so we need to make use of - # `label' feature and the `N' command in order to build a pattern - # space that includes the newline character in it. Here we use the - # `a' letter to name the label we use, followed by N command to - # add a newline to the pattern space, the s command to make the - # pattern replacement using the `g' flag to make it global and - # finally the command `b' to branch label named `a'. - # - # Inside the pattern space, the `\<' and `\>' are used to restrict - # the match pattern to a word boundary. The word boundary - # restriction applied here is required to avoid undesired - # replacements when we replace singular words with their plurals. - # For example, if we need to change the node `Manual' to its - # plural (i.e., `Manuals'), and no boundary restriction is used in - # the pattern space to do that, we might end up having nodes like - # `Manualsssss' which probably doesn't exist. This is because this - # sed command might be applied to the same file more than once; - # and each time it is applied, a new `Manuals' replaces the - # previous `Manuals' replacement to form `Manualss', `Manualsss', - # and so on for each interaction. Using word boundaries - # restrictions prevent such issue from happening. - sed -r -i ":a;N;s!${PATTERN[0]}!${REPLACE[0]}!g;ba" ${MANUAL_ENTRIES} - - # Update menu cross references. Menu cross reference definitions - # hardly appear in more than one line, so there is no need to - # complicate the replacement command. - sed -r -i "s!${PATTERN[1]}!${REPLACE[1]}!" ${MANUAL_ENTRIES} - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_renameEntry.sh b/Automation/Modules/Help/Texinfo/texinfo_renameEntry.sh deleted file mode 100755 index a626922..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_renameEntry.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash -# -# texinfo_renameEntry.sh -- This function standardizes renaming tasks -# related to manual, chapters and sections inside the working copy. -# -# Copyright (C) 2009-2013 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_renameEntry { - - # Initialize source and target locations. - local MANUAL_ENTRY_SRC='' - local MANUAL_ENTRY_DST='' - - # Define both source and target documentation entries. To build - # the source and target documentation entries we take into - # consideration the manual's main definition file, the chapter's - # main definition file and non-option arguments passed to - # centos-art.sh script through the command-line. - if [[ ${MANUAL_SECT[${MANUAL_DOCENTRY_ID}]} != '' ]];then - - # When a section is renamed, the section source location is - # duplicated into the section target location and later - # removed from the working copy. Once the section source - # location has been renamed, the section menu, nodes and cross - # references are updated to keep consistency inside the - # manual. - texinfo_renameEntrySection - - elif [[ ${MANUAL_CHAP[$MANUAL_DOCENTRY_ID]} != '' ]] \ - && [[ ${MANUAL_CHAP[(($MANUAL_DOCENTRY_ID + 1))]} != '' ]];then - - # When a chapter is renamed, the chapter source location is - # duplicated into the chapter source location and later - # removed from the working copy. Once the chapter source - # location has been renamed, the chapter and section menu, - # nodes and cross references are updated to keep consistency - # inside the manual. - texinfo_renameEntryChapter - - elif [[ ${MANUAL_DIRN[$MANUAL_DOCENTRY_ID]} != '' ]] \ - && [[ ${MANUAL_DIRN[(($MANUAL_DOCENTRY_ID + 1))]} != '' ]] ;then - - # When a manual is renamed, a new manual structure is created - # in the manual target location and all chapters and sections - # are duplicated from manual source location to manual target - # location. Once the source manual has been renamed, chapter - # and section menu, nodes and cross references are updated to - # keep consistency inside the manual. - texinfo_renameEntryManual - - else - cli_printMessage "`gettext "The parameters you provided are not supported."`" --as-error-line - fi - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_renameEntryChapter.sh b/Automation/Modules/Help/Texinfo/texinfo_renameEntryChapter.sh deleted file mode 100755 index 18cf697..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_renameEntryChapter.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -# -# texinfo_renameEntryChapter.sh -- This function standardizes renaming -# tasks related to manual chapters inside documentation manuals -# written in texinfo format. -# -# Copyright (C) 2009-2013 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_renameEntryChapter { - - # Copy section source entry to target location. - texinfo_copyEntryChapter - - # Delete section source entry. - texinfo_deleteEntryChapter - - # Rename menu, nodes and cross references related entries. - texinfo_renameCrossReferences - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_renameEntryManual.sh b/Automation/Modules/Help/Texinfo/texinfo_renameEntryManual.sh deleted file mode 100755 index ce9d8a1..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_renameEntryManual.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash -# -# texinfo_renameEntryManual.sh -- This function standardizes renaming -# tasks related to documenation manuals written in texinfo format -# inside the working copy. -# -# Copyright (C) 2009-2013 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_renameEntryManual { - - # Copy section source entry to target location. - texinfo_copyEntryManual - - # Delete section source entry. - texinfo_deleteEntryManual - - # Redefine absolute paths to changed directories. This is - # required in order for `cli_synchronizeRepoChanges' to be aware - # of manual source and target locations we've just renamed. - MANUAL_CHANGED_DIRS="${MANUAL_BASEDIR} $(echo $MANUAL_BASEDIR \ - | sed -r "s!${MANUAL_DIRN[${MANUAL_DOCENTRY_ID}]}!${MANUAL_DIRN[((${MANUAL_DOCENTRY_ID} + 1))]}!")" - - # From this time on, the manual information set so far is no - # longer useful. Redefine it to start using the new manual - # information instead. - - # Redefine manual name using manual name passed to `centos-art.sh' - # script as second non-option argument. - MANUAL_NAME=${MANUAL_SLFN[((${MANUAL_DOCENTRY_ID} + 1))]} - - # Redefine absolute path to manual directory using manual name - # passed to `centos-art.sh' script as second non-option argument. - MANUAL_BASEDIR="$(echo $MANUAL_BASEDIR \ - | sed -r "s!${MANUAL_DIRN[${MANUAL_DOCENTRY_ID}]}!${MANUAL_DIRN[((${MANUAL_DOCENTRY_ID} + 1))]}!")" - - # Redefine absolute path to manual directory using manual name - # passed to `centos-art.sh' script as second non-option argument. - MANUAL_BASEDIR_L10N="${MANUAL_BASEDIR}/${MANUAL_L10N}" - - # Redefine absolute path to base file using manual name passed to - # `centos-art.sh' script as second non-option argument. - MANUAL_BASEFILE="${MANUAL_BASEDIR_L10N}/${MANUAL_NAME}" - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_renameEntrySection.sh b/Automation/Modules/Help/Texinfo/texinfo_renameEntrySection.sh deleted file mode 100755 index 771929a..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_renameEntrySection.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -# -# texinfo_renameEntrySection.sh -- This function standardizes renaming -# tasks related to chapter sections inside documentation manuals -# written in texinfo format. -# -# Copyright (C) 2009-2013 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_renameEntrySection { - - # Copy section source entry to target location. - texinfo_copyEntrySection - - # Delete section source entry. - texinfo_deleteEntrySection - - # Rename menu, nodes and cross references related entries. - texinfo_renameCrossReferences - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_restoreCrossReferences.sh b/Automation/Modules/Help/Texinfo/texinfo_restoreCrossReferences.sh deleted file mode 100755 index e7389c0..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_restoreCrossReferences.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/bash -# -# texinfo_restoreCrossReferences.sh -- This function looks inside -# texinfo source files, from section level on, and restores any cross -# reference related to a documentation entry. This function is used in -# those cases where documentation entries are created/recreated to -# documentation structure. It is a verification that looks for -# matching documentation entries previously defined as removed by -# texinfo_deleteCrossReferences function. The -# texinfo_restoreCrossReferences function relays in the removed -# message format produced by texinfo_deleteCrossReferences -# function, in order to return them back into the link format. -# -# Copyright (C) 2009-2013 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_restoreCrossReferences { - - local -a PATTERN - local -a REPLACE - - # Define documentation entry. - local MANUAL_ENTRY="$1" - - # Verify documentation entry. If documentation entry is empty, - # stop script execution with an error message. - if [[ $MANUAL_ENTRY == '' ]];then - cli_printMessage "`gettext "The first positional parameter cannot be empty."`" --as-error-line - fi - - # Build the node string using entry location. - local NODE="$(texinfo_getEntryNode "$MANUAL_ENTRY")" - - # Define regular expression patterns to match removed message - # format produced by message_removeCrossReferences function. - PATTERN[0]="--- @strong\{`gettext "Removed"`\}\((pxref|xref|ref):(${NODE})\) ---" - PATTERN[1]="^@comment --- `gettext "Removed"`\((\* ${NODE}:(.*)?:(.*)?)\) ---$" - - # Define replacement string to turn removed message back to cross - # reference link. - REPLACE[0]='\@\1{\2}' - REPLACE[1]='\1' - - # Define list of entries to process. - local MANUAL_ENTRIES=$(cli_getFilesList ${MANUAL_BASEDIR_L10N} \ - --pattern="^.+\.${MANUAL_EXTENSION}$") - - # Update node-related cross references. The node-related cross - # reference definition, long ones specially, could require more - # than one line to be set. By default, GNU sed does not matches - # newline characters in the pattern space, so we need to make use - # of `label' feature and the `N' command in order to build a - # pattern space that includes the newline character in it. Here we - # use the `a' letter to name the label we use, followed by N - # command to add a newline to the pattern space, the s command to - # make the pattern replacement using the `g' flag to make it - # global and finally the command `b' to branch label named `a'. - sed -r -i ":a;N;s!${PATTERN[0]}!${REPLACE[0]}!g;ba" ${MANUAL_ENTRIES} - - # Update menu-related cross references. Menu-related cross - # references hardly appear in more than one line, so there is no - # need to complicate the replacement command. - sed -r -i "s!${PATTERN[1]}!${REPLACE[1]}!" ${MANUAL_ENTRIES} - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_searchIndex.sh b/Automation/Modules/Help/Texinfo/texinfo_searchIndex.sh deleted file mode 100755 index 9e62307..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_searchIndex.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -# -# texinfo_searchIndex.sh -- This function does an index search inside the -# info document. -# -# Copyright (C) 2009-2013 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_searchIndex { - - # Verify manual output files and, if they don't exist, create - # them. - if [[ ! -f ${MANUAL_BASEFILE}.info.bz2 ]];then - texinfo_updateOutputFiles - fi - - # Print separator line. - cli_printMessage '-' --as-separator-line - - # Print action message. - cli_printMessage "${MANUAL_BASEFILE}.info.bz2" --as-reading-line - - # Execute info command to perform an index-search. - /usr/bin/info --index-search="$FLAG_SEARCH" --file=${MANUAL_BASEFILE}.info.bz2 - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_searchNode.sh b/Automation/Modules/Help/Texinfo/texinfo_searchNode.sh deleted file mode 100755 index a22749a..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_searchNode.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash -# -# texinfo_searchNode.sh -- This function converts the documentation -# entry provided to `centos-art.sh' script command-line into a node -# and tries to read it from the manual's `.info' output file. -# -# Copyright (C) 2009-2013 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_searchNode { - - # Verify documentation entry and, if it doesn't exist, prompt out - # its creation. - if [[ ! -f "$MANUAL_ENTRY" ]];then - texinfo_editEntry - fi - - # Verify manual output files and, if they don't exist, create - # them. - if [[ ! -f ${MANUAL_OUTPUT_BASEFILE}.info.bz2 ]];then - texinfo_updateOutputFiles - fi - - # Print separator line. - cli_printMessage '-' --as-separator-line - - # Print action message. - cli_printMessage "${MANUAL_OUTPUT_BASEFILE}.info.bz2" --as-reading-line - - # Define manual node that will be read. - local MANUAL_NODE="$(texinfo_getEntryNode "$MANUAL_ENTRY")" - - # Verify manual node that will be read. When the manual name is - # the only value passed as documentation entry, then use the `Top' - # node as manual node to be read. - if [[ $MANUAL_NODE =~ $(texinfo_getEntryNode "$MANUAL_NAME") ]];then - MANUAL_NODE='Top' - fi - - # Use info reader to read the manual node. - info --node="${MANUAL_NODE}" --file="${MANUAL_OUTPUT_BASEFILE}.info.bz2" - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_updateChapterMenu.sh b/Automation/Modules/Help/Texinfo/texinfo_updateChapterMenu.sh deleted file mode 100755 index b9d5433..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_updateChapterMenu.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/bash -# -# texinfo_updateChapterMenu.sh -- This function updates chapter menu. -# -# Copyright (C) 2009-2013 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_updateChapterMenu { - - local ACTION=$1 - local MENUCHAPTERS='' - - # Print action name. - cli_printMessage "${MANUAL_BASEFILE}-menu.${MANUAL_EXTENSION}" --as-creating-line - - # Build menu of chapters. The Index node is not included as other - # nodes are. The Index node is defined inside the master texinfo - # file (repository.texinfo) as an included file. To create the final - # .info file correctly, the Index line in the menu should remain, - # even no other node exist. - if [[ -f ${MANUAL_BASEFILE}-menu.${MANUAL_EXTENSION} ]];then - MENUCHAPTERS=$(cat ${MANUAL_BASEFILE}-menu.${MANUAL_EXTENSION} \ - | egrep -v "^@(end )?menu$" \ - | egrep -v '^\* (Licenses|Index)::$') - fi - - # Re-defined menu of chapters based on action. - case $ACTION in - - --delete-entry ) - # Remove chapter from menu. - MENUCHAPTERS=$(echo "${MENUCHAPTERS}" \ - | egrep -v '^\* '"${MANUAL_CHAPTER_NAME}"'::[[:print:]]*$') - ;; - - --add-entry | * ) - # Update chapter menu using texinfo format. Be sure the - # chapter node itself is not included here, that would - # duplicate it inside the menu definition file which end - # up being a definition error. Take care the way you quote - # egrep's pattern, prevent to end up using the syntax - # `$"..."' which has security risks. - MENUCHAPTERS="$(echo "${MENUCHAPTERS}" \ - | egrep -v '\* '"${MANUAL_CHAPTER_NAME}"'::[[:print:]]*$') - * ${MANUAL_CHAPTER_NAME}::" - ;; - esac - - # Remove opening spaces/tabs and empty line from the menu of - # chapters. Empty lines may occur the first time the menu of - # chapters is created. - MENUCHAPTERS=$(echo "${MENUCHAPTERS}" | sed -r 's!^[[:space:]]+!!' \ - | egrep -v '^[[:space:]]*$') - - # Organize menu of chapters alphabetically and verify that no - # duplicated line be included on the list. Notice that organizing - # menu this way suppresses the idea of putting the last chapter - # created at the end of the list. - #MENUCHAPTERS=$(echo "${MENUCHAPTERS}" | sort | uniq) - - # Give format to final menu output. - MENUCHAPTERS="@menu - ${MENUCHAPTERS} - * Licenses:: - * Index:: - @end menu" - - # Remove opening space/tabs from menu's final definition. - MENUCHAPTERS=$(echo "${MENUCHAPTERS}" | sed -r 's!^[[:space:]]+!!' \ - | egrep -v '^[[:space:]]*$') - - # Dump organized menu of chapters into file. - echo "${MENUCHAPTERS}" > ${MANUAL_BASEFILE}-menu.${MANUAL_EXTENSION} - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_updateChapterNodes.sh b/Automation/Modules/Help/Texinfo/texinfo_updateChapterNodes.sh deleted file mode 100755 index f82b0b4..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_updateChapterNodes.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash -# -# texinfo_updateChapterNodes.sh -- This function updates nodes of -# chapters based on menu of chapters. -# -# Copyright (C) 2009-2013 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_updateChapterNodes { - - # Print action name. - cli_printMessage "${MANUAL_BASEFILE}-nodes.${MANUAL_EXTENSION}" --as-creating-line - - # Build chapter nodes using entries from chapter menu as - # reference. Don't include `Licenses' or `Index' chapters here. - # These chapters are part of our manual's main definition file and - # shouldn't be handled as regular chapters. - local CHAPTERNODES=$(cat ${MANUAL_BASEFILE}-menu.${MANUAL_EXTENSION} \ - | egrep -v '^@(end )?menu$' | egrep -v '^\* (Licenses|Index)::$'\ - | sed -r 's!^\* !!' | sed -r 's!::[[:print:]]*$!!g' \ - | sed -r 's! !_!g') - - # Build list of inclusions from chapter nodes. - local FILENODE=$(\ - for CHAPTERNODE in ${CHAPTERNODES};do - INCL=$(echo ${CHAPTERNODE} \ - | sed -r "s!(${CHAPTERNODE})!\1.${MANUAL_EXTENSION}!") - # Output inclusion line using texinfo format. - echo "@include $INCL" - done) - - # Dump organized nodes of chapters into file. - echo "$FILENODE" > ${MANUAL_BASEFILE}-nodes.${MANUAL_EXTENSION} - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_updateLicenseLink.sh b/Automation/Modules/Help/Texinfo/texinfo_updateLicenseLink.sh deleted file mode 100755 index 273e6b0..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_updateLicenseLink.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -# -# texinfo_updateLicenseLink.sh -- This function updates the link -# information related to License directory used by Texinfo -# documentation manuals. There isn't a need to duplicate the License -# information in each documentation manual. In fact it is important -# not to have it duplicated so we can centralize such information for -# all documentation manuals. -# -# Copyright (C) 2009-2013 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_updateLicenseLink { - - # Define directory where license templates are stored in. - local DIR=${TCAR_WORKDIR}/Documentation/Models/Texinfo/Default/${CLI_LANG_LC} - - # Define files related to license templates. - local FILES=$(find ${DIR} -name 'Licenses*') - - for FILE in $FILES;do - - # Remove path from license templates. - FILE=$(basename ${FILE}) - - # Remove license files from manual's specific models. All - # these files are symbolic links. If they aren't, stop the - # script execution with an error message. In this case you - # need to fix your directory structure first (e.g., by - # fetching a more up-to-date version of it from central - # repository). - if [[ -h ${MANUAL_BASEDIR_L10N}/${FILE} ]];then - rm ${MANUAL_BASEDIR_L10N}/${FILE} - else - cli_printMessage "${MANUAL_BASEDIR_L10N} `gettext "has an old directory structure."`" --as-error-line - fi - - # Create link from manual's default models to manual's - # specific models. - ln -s ${DIR}/${FILE} ${MANUAL_BASEDIR_L10N}/${FILE} - - done - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_updateOutputFileDocbook.sh b/Automation/Modules/Help/Texinfo/texinfo_updateOutputFileDocbook.sh deleted file mode 100755 index 2937ad6..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_updateOutputFileDocbook.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# -# texinfo_updateOutputFileDocbook.sh -- This function exports -# documentation manual to DocBook format. -# -# Copyright (C) 2009-2013 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_updateOutputFileDocbook { - - # Print action message. - cli_printMessage "${MANUAL_OUTPUT_BASEFILE}.docbook" --as-creating-line - - # Update xml output format. - /usr/bin/makeinfo --docbook --output=${MANUAL_OUTPUT_BASEFILE}.docbook \ - ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} --no-warn - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_updateOutputFileInfo.sh b/Automation/Modules/Help/Texinfo/texinfo_updateOutputFileInfo.sh deleted file mode 100755 index 9a462fe..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_updateOutputFileInfo.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -# -# texinfo_updateOutputFileInfo.sh -- This function exports -# documentation manual to info format. -# -# Copyright (C) 2009-2013 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_updateOutputFileInfo { - - # Output action message. - cli_printMessage "${MANUAL_OUTPUT_BASEFILE}.info.bz2" --as-creating-line - - # Update info file. - /usr/bin/makeinfo --output=${MANUAL_OUTPUT_BASEFILE}.info \ - --enable-encoding \ - ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} - - # Compress info file. - if [[ $? -eq 0 ]];then - bzip2 -f ${MANUAL_OUTPUT_BASEFILE}.info - fi - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_updateOutputFilePdf.sh b/Automation/Modules/Help/Texinfo/texinfo_updateOutputFilePdf.sh deleted file mode 100755 index c93c6f5..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_updateOutputFilePdf.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -# -# texinfo_updateOutputFilePdf.sh -- This function exports documentation -# manual to PDF format. -# -# Copyright (C) 2009-2013 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_updateOutputFilePdf { - - # Verify texi2pdf package existence. If this package isn't - # installed in the system, stop script execution with an error - # message. texi2pdf isn't a package by itself but a program of - # texinfo-tex package. So check the correct package. - cli_checkFiles texinfo-tex --is-installed - - # Output action message. - cli_printMessage "${MANUAL_OUTPUT_BASEFILE}.pdf" --as-creating-line - - # Update plaintext output directory. - /usr/bin/texi2pdf --quiet \ - ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} --output=${MANUAL_OUTPUT_BASEFILE}.pdf - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_updateOutputFilePlaintext.sh b/Automation/Modules/Help/Texinfo/texinfo_updateOutputFilePlaintext.sh deleted file mode 100755 index 4d753b8..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_updateOutputFilePlaintext.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -# -# texinfo_updateOutputFilePlaintext.sh -- This function exports -# documentation manual to plain-text format. -# -# Copyright (C) 2009-2013 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_updateOutputFilePlaintext { - - # Output action message. - cli_printMessage "${MANUAL_OUTPUT_BASEFILE}.txt.bz2" --as-creating-line - - # Update plaintext output directory. - /usr/bin/makeinfo --plaintext \ - ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} --output=${MANUAL_OUTPUT_BASEFILE}.txt - - # Compress plaintext output file. - if [[ -f ${MANUAL_OUTPUT_BASEFILE}.txt ]];then - bzip2 ${MANUAL_OUTPUT_BASEFILE}.txt --force - fi - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_updateOutputFileXhtml.sh b/Automation/Modules/Help/Texinfo/texinfo_updateOutputFileXhtml.sh deleted file mode 100755 index 05acbf3..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_updateOutputFileXhtml.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/bin/bash -# -# texinfo_updateOutputFileXhtml.sh -- This function exports -# documentation manual to HTML format. -# -# Copyright (C) 2009-2013 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_updateOutputFileXhtml { - - # Verify texi2html package existence. If this package isn't - # installed in the system, stop script execution with an error - # message. - cli_checkFiles texi2html --is-installed - - # Output action message. - cli_printMessage "${MANUAL_OUTPUT_BASEFILE}.xhtml.tar.bz2" --as-creating-line - - # Verify initialization files used by texi2html. - cli_checkFiles -e ${MANUAL_TEMPLATE}/manual-init.pl - cli_checkFiles -e ${MANUAL_TEMPLATE_L10N}/manual-init.pl - - # Verify transformation files used to modify texi2html output. - cli_checkFiles -e ${MANUAL_TEMPLATE}/manual.sed - cli_checkFiles -e ${MANUAL_TEMPLATE_L10N}/manual.sed - - # Clean up directory structure where xhtml files will be stored. - # We don't want to have unused files inside it. - if [[ -d ${MANUAL_OUTPUT_BASEFILE}-xhtml ]];then - rm -r ${MANUAL_OUTPUT_BASEFILE}-xhtml - fi - - # Prepare directory structure where xhtml files will be stored in. - mkdir -p ${MANUAL_OUTPUT_BASEFILE}-xhtml - - # Add manual base directory path into directory stack to make it - # the current working directory. This is done to reduce the path - # information packaged inside `repository.xhtml.tar.bz2' file. - pushd ${MANUAL_OUTPUT_BASEFILE}-xhtml > /dev/null - - # Update xhtml files. Use texi2html to export from texinfo file - # format to xhtml using The CentOS Web default visual style. - texi2html --lang=${CLI_LANG_LL} \ - --init-file=${MANUAL_TEMPLATE}/manual-init.pl \ - --init-file=${MANUAL_TEMPLATE_L10N}/manual-init.pl \ - -I ${TCAR_WORKDIR} \ - --output=${MANUAL_OUTPUT_BASEFILE}-xhtml \ - ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} - - # Create `css' and `images' directories. In order to save disk - # space, these directories are linked (symbolically) to their - # respective locations inside the working copy. - ln -s ${TCAR_WORKDIR}/Identity/Webenv/Themes/Default/Docbook/1.69.1/Css Css - ln -s ${TCAR_WORKDIR}/Identity/Images/Webenv Images - - # Remove directory where xhtml files are stored from directory - # stack. The xhtml files have been already created. - popd > /dev/null - - # Apply xhtml transformations. This transformation cannot be built - # inside the initialization script (repository-init.pl). For example, - # Would it be a possible way to produce different quotation HTML - # outputs from the same texinfo quotation definition? Instead, - # once the HTML code is produced we can take the quotation HTML - # definition plus the first letters inside it and transform the - # structure to a completely different thing that can be handle - # through classed inside CSS definitions. - sed -r -i \ - -f ${MANUAL_TEMPLATE}/manual.sed \ - -f ${MANUAL_TEMPLATE_L10N}/manual.sed \ - ${MANUAL_OUTPUT_BASEFILE}-xhtml/*.xhtml - - # Compress directory structure where xhtml files are stored in. - # This compressed version is the one we put under version control. - # The directory used to build the compressed version is left - # unversion for the matter of human revision. - tar -cjf ${MANUAL_OUTPUT_BASEFILE}.xhtml.tar.bz2 ${MANUAL_OUTPUT_BASEFILE}-xhtml > /dev/null 2>&1 - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_updateOutputFileXml.sh b/Automation/Modules/Help/Texinfo/texinfo_updateOutputFileXml.sh deleted file mode 100755 index 4a60c3f..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_updateOutputFileXml.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# -# texinfo_updateOutputFileXml.sh -- This function exports documentation -# manual to XML format. -# -# Copyright (C) 2009-2013 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_updateOutputFileXml { - - # Print action message. - cli_printMessage "${MANUAL_OUTPUT_BASEFILE}.xml" --as-creating-line - - # Update xml output format. - /usr/bin/makeinfo --xml \ - ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} --output=${MANUAL_OUTPUT_BASEFILE}.xml \ - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_updateOutputFiles.sh b/Automation/Modules/Help/Texinfo/texinfo_updateOutputFiles.sh deleted file mode 100755 index ed1eedc..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_updateOutputFiles.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash -# -# texinfo_updateOutputFiles.sh -- This function exports documentation -# manual to different output formats. -# -# Copyright (C) 2009-2013 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_updateOutputFiles { - - # Verify manual base file. We can update manual outputs only if - # its base file exists. For example, we cannot update manual - # outputs if the manual has been deleted previously. - if [[ ! -a ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} ]];then - return - fi - - # Verify output directory. - if [[ ! -d $(dirname $MANUAL_OUTPUT_BASEFILE) ]];then - mkdir -p $(dirname $MANUAL_OUTPUT_BASEFILE) - fi - - # Move script execution to manuals base directory in order for - # makeinfo to produce content correctly. This is the location - # where the documentation's main definition file is stored in. - # Related content outside this location is accessible through - # symbolic links. - pushd ${MANUAL_BASEDIR_L10N} > /dev/null - - # Verify existence of link to Licenses information. - texinfo_updateLicenseLink - - # Keep the order in which these actions are performed. Begin with - # actions that use the makeinfo file to realize the export. Later, - # continue with action that need other tools to realize the export - # (e.g., texi2html to produce XHTML and texi2pdf to produce PDF - # outputs). - texinfo_updateOutputFileInfo - texinfo_updateOutputFileXml - texinfo_updateOutputFileDocbook - texinfo_updateOutputFilePlaintext - texinfo_updateOutputFileXhtml - texinfo_updateOutputFilePdf - - # Remove the working copy root directory from directory stack. - popd > /dev/null - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_updateSectionMenu.sh b/Automation/Modules/Help/Texinfo/texinfo_updateSectionMenu.sh deleted file mode 100755 index 03c9315..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_updateSectionMenu.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/bin/bash -# -# texinfo_updateSectionMenu.sh -- This function updates the section's -# menu definition file of a chapter. If this function is called with -# the '--delete-entry' string as first argument, the menu line related -# to the entry being processed is removed. Otherwise, if this function -# is called with the '--add-entry' string as first argument, the menu -# line related to the entry being processed is added to menu's bottom. -# If no argument is passed to this function, the '--add-entry' action -# is assumed. -# -# Copyright (C) 2009-2013 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_updateSectionMenu { - - # Specify which action to do with documentation entry inside the - # chapter menu. - local ACTION="$1" - - # Define section order. Through this property you can customize - # the section order inside the manual. Possible arguments to this - # option are `ordered', `reversed', `created'. From these three - # values `created' is used by default (i.e., new menu entries are - # added to menu's bottom as last entry.). Notice that, once - # you've sorted the menu using `ordered' or `reversed' values, it - # is hard to sort the list back to former creation orders. Go - # sorted or not sorted at all. - local MANUAL_SECTION_ORDER=$(cli_getConfigValue "${MANUAL_CONFIG_FILE}" "main" "manual_section_order") - if [[ ! $MANUAL_SECTION_ORDER =~ '^(created|ordered|reversed)$' ]];then - MANUAL_SECTION_ORDER='created' - fi - - # Build node information used inside chapter menu. - local MENUNODE=$(texinfo_getEntryNode "$MANUAL_ENTRY") - - # Define menu entry using texinfo style and node information as - # reference. - local MENULINE="* ${MENUNODE}::" - - # Retrieve list of menu entries from chapter menu and exclude - # `@menu', `@end menu' and empty lines from output. - local MENU=$(cat ${MENUFILE} \ - | egrep -v '^[[:space:]]*$' | egrep -v '^@(end )?menu') - - # Re-defined chapter menu entries based on action provided to this - # function as first positional parameter. - case $ACTION in - - --delete-entry ) - # Remove menu entry from chapter menu. - MENU="$(echo "$MENU" | egrep -v "$MENULINE")" - ;; - - --add-entry | * ) - # Add menu entry to chapter menu list as last entry. - MENU="$(echo "$MENU" | egrep -v "$MENULINE" ) - ${MENULINE}" - ;; - - esac - - # Remove opening spaces/tabs and empty lines from final menu - # entries. - MENU=$(echo "$MENU" | sed -r 's!^[[:space:]]+!!g' \ - | egrep -v '^[[:space:]]*$') - - # Sort menu entries based on section order property. - case $MANUAL_SECTION_ORDER in - - 'ordered' ) - MENU="$(echo "$MENU" | sort )" - ;; - - 'reversed' ) - MENU="$(echo "$MENU" | sort -r )" - ;; - - esac - - # Rebuild list of chapter menu entries including '@menu' and '@end - # menu' lines back into chapter menu. - MENU="@menu - $MENU - @end menu" - - # Remove opening spaces/tabs and empty lines from final menu - # structure. - MENU=$(echo "$MENU" | sed -r 's!^[[:space:]]+!!g' \ - | egrep -v '^[[:space:]]*$') - - # Dump chapter menu entries back into chapter's menu definition - # file. - echo "$MENU" > ${MENUFILE} - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_updateSectionNodes.sh b/Automation/Modules/Help/Texinfo/texinfo_updateSectionNodes.sh deleted file mode 100755 index 58d4c30..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_updateSectionNodes.sh +++ /dev/null @@ -1,145 +0,0 @@ -#!/bin/bash -# -# texinfo_updateSectionNodes.sh -- This function updates section's -# nodes definition files using section's menu definition file both -# inside the same chapter. -# -# Copyright (C) 2009-2013 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_updateSectionNodes { - - # Define node file. - local NODEFILE=$(echo $MENUFILE | sed -r "s,-menu,-nodes,") - - # Build list of chapter nodes using entries from chapter menu as - # reference. - local NODES=$(cat ${MENUFILE} \ - | sed -r 's!^\* !!' | sed -r 's!:{1,2}.*$!!g' \ - | egrep -v '^@(end )?menu$' | sed -r 's! !:!g') - - # Build chapter nodes based on chapter menu. - for NODE in $NODES;do - - local NODE=$(echo "${NODE}" | sed -r 's!:! !g') - local INCL=$(echo "${NODE}" | sed -r -e 's! !/!' -e 's! !-!g' -e's!/(.+)!/\L\1!').${MANUAL_EXTENSION} - local SECT=$(texinfo_getEntryTitle "$NODE") - local CIND=$(texinfo_getEntryIndex "$NODE") - - # Initialize absolute path to final texinfo template. - local TEMPLATE='' - - # Create texinfo section file using templates, only if the - # section file doesn't exist and hasn't been marked for - # deletion. Otherwise, when the files have been marked for - # deletion, they will be created again from texinfo template - # to working copy and that might create confusion. - if [[ ! -f ${MANUAL_BASEDIR_L10N}/$INCL ]] \ - && [[ $(cli_runFnEnvironment vcs --status ${MANUAL_BASEDIR_L10N}/$INCL) != 'D' ]];then - - # Retrieve configuration lines from configuration file. Be - # sure no line beginning with `#' or space remain in the - # line. Otherwise, it would be difficult to loop through - # configuration lines. - local CONFLINE='' - local CONFLINES=$(cli_getConfigLines "${MANUAL_CONFIG_FILE}" "templates" "*") - - # Initialize both left hand side and right hand side - # configuration values. - local CONFLHS='' - local CONFRHS='' - - # Define what section template to apply using - # documentation entry absolute path and values provided by - # configuration line. Be sure to break the loop in the - # first match. - for CONFLINE in $CONFLINES;do - - CONFLHS=$(echo $CONFLINE \ - | gawk 'BEGIN{FS="="}; { print $1 }' \ - | sed -r 's![[:space:]]*!!g') - - CONFRHS=$(echo $CONFLINE \ - | gawk 'BEGIN{FS="="}; { print $2 }' \ - | sed -r -e 's![[:space:]]*!!g' -e 's!^"(.+)"$!\1!') - - if [[ ${MANUAL_BASEDIR_L10N}/${INCL} =~ $CONFRHS ]];then - TEMPLATE="${MANUAL_TEMPLATE_L10N}/${CONFLHS}" - break - fi - - done - - # Verify existence of texinfo template file. If no - # template is found, stop script execution with an error - # message. We cannot continue without it. - cli_checkFiles -e ${TEMPLATE} - - # Create documentation entry using texinfo template as - # reference. - cli_runFnEnvironment vcs --copy --quiet ${TEMPLATE} ${MANUAL_BASEDIR_L10N}/$INCL - - fi - - # Expand common translation markers in documentation entry. - cli_expandTMarkers "${MANUAL_BASEDIR_L10N}/$INCL" - - # Replace node, section and concept index definitions already - # defined with node, section and concept index translation - # markers. Otherwise, incorrect sectioning may happen. Take - # care with index definitions, more than one index definition - # might be found in the section file but only the first - # concept index entry (i.e., `cindex') will be updated, the - # rest will remain as they are. - sed -i -r \ - -e '/^@node/c@node =NODE=' \ - -e '/^@section/c@section =SECT=' \ - -e '0,/^@cindex/c@cindex =CIND=' \ - "${MANUAL_BASEDIR_L10N}/$INCL" - - # Before expanding node, section and concept index, be sure - # that all slash characters (`/') be escaped. Otherwise, they - # might be interpreted as separators and that isn't - # desirable in anyway. - NODE=$(echo "$NODE" | sed -r 's/\//\\\//g') - SECT=$(echo "$SECT" | sed -r 's/\//\\\//g') - CIND=$(echo "$CIND" | sed -r 's/\//\\\//g') - - # Expand node, section and concept index translation - # markers in documentation entry. - sed -i -r \ - -e "s/=NODE=/${NODE}/g" \ - -e "s/=SECT=/${SECT}/g" \ - -e "s/=CIND=/${CIND}/g" \ - "${MANUAL_BASEDIR_L10N}/$INCL" - - # Verify existence of Chapter-nodes template file. If no - # Chapter-nodes template is found, stop script execution with - # an error message. We cannot continue without it. - cli_checkFiles -e ${MANUAL_TEMPLATE_L10N}/Chapters-nodes.${MANUAL_EXTENSION} - - # Expand chapter node inclusion definition. - cat ${MANUAL_TEMPLATE_L10N}/Chapters-nodes.${MANUAL_EXTENSION} \ - | sed -r "s!=INCL=!${INCL}!g" - - # Dump chapter node definition into manual structure. - done > ${NODEFILE} - -} diff --git a/Automation/Modules/Help/Texinfo/texinfo_updateStructureSection.sh b/Automation/Modules/Help/Texinfo/texinfo_updateStructureSection.sh deleted file mode 100755 index b9bd1d6..0000000 --- a/Automation/Modules/Help/Texinfo/texinfo_updateStructureSection.sh +++ /dev/null @@ -1,140 +0,0 @@ -#!/bin/bash -# -# texinfo_updateStructureSection.sh -- This function looks for all -# section entries (i.e., files holding section definitions) inside the -# manual's base directory and updates menu, nodes and cross references -# definitions for them all, one at a time. -# -# Copyright (C) 2009-2013 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_updateStructureSection { - - local PATTERN="${1}" - - # Define regular expression pattern used to build list of section - # entries when pattern points to manual's file name or it is not - # provided at all. - if [[ $PATTERN =~ "${MANUAL_NAME}\.${MANUAL_EXTENSION}$" ]] \ - || [[ $PATTERN == '' ]]; then - PATTERN="/.+\.${MANUAL_EXTENSION}$" - fi - - local MANUAL_ENTRY='' - local MANUAL_ENTRIES='' - local ACTIONNAM_SECMENU='' - local ACTIONNAM_CROSREF='' - - # Define action to perform on menu, nodes and cross references - # definitions. - case "$2" in - - --delete ) - - # Remove menu and node definitions for sections inside - # manual, in order to reflect the changes. - ACTIONNAM_SECMENU='texinfo_updateSectionMenu --delete-entry' - - # Remove cross reference definitions inside manual - # structure. - ACTIONNAM_CROSREF='texinfo_deleteCrossReferences' - ;; - - --update | * ) - - # Update menu and node definitions for sections inside - # manual, in order to reflect the changes. - ACTIONNAM_SECMENU='texinfo_updateSectionMenu --add-entry' - - # Restore cross reference definitions inside manual - # structure. If a documentation entry has been removed by - # mistake and that mistake is later fixed by adding the - # removed documentation entry back into the manual - # structure, it is necessary to rebuild the missing cross - # reference information inside the manual structure in - # order to reactivate the removed cross references, as - # well. - ACTIONNAM_CROSREF='texinfo_restoreCrossReferences' - ;; - - esac - - # Define list of target entries using find's regular expression - # pattern as reference. Notice that, when we update section - # definition files, the files already exist in the working copy so - # the pattern can be its absolute path without any problem. If the - # pattern is built correctly, it will match the location and so be - # returned to build the list of entries to process. Notice also - # that, when updating, it is possible to use a regular expression - # to match more than one location and build the list of entries - # based on such matching. In this last configuration, let you to - # update menu, nodes and cross references to many section - # definitions (i.e., all those section definition file that match - # the pattern you specified). - MANUAL_ENTRIES=$(cli_getFilesList ${MANUAL_BASEDIR_L10N} \ - --pattern="${PATTERN}" --mindepth="2" --maxdepth="2") - - # Verify list of target entries. Assuming is is empty, define - # list of target documentation entries using pattern as reference - # instead. When we delete a section entry from the working copy, - # using find to retrieve its path isn't possible because the - # section definition file is removed before executing find and by - # consequence no match is found. This issue provokes no section - # entry to be removed from menu, nodes and cross references. In - # order to solve this, use the pattern value as list of target - # entries. Notice that, in this case, the pattern value must be - # the absolute path to that documentation entry which doesn't - # exist and we want to update menu, nodes and cross references - # information for. - if [[ $MANUAL_ENTRIES == '' ]] && [[ $PATTERN =~ '^/[[:alnum:]./_-]+$' ]];then - MANUAL_ENTRIES=${PATTERN} - fi - - # Verify list of target entries. Assuming it is still empty, there - # is nothing else to do here but printing an error message - # describing the fact that no section entry was found to process. - if [[ $MANUAL_ENTRIES == '' ]];then - cli_printMessage "`gettext "There wasn't any section for processing found."`" --as-error-line - fi - - # Loop through target documentation entries in order to update the - # documentation structure (e.g., it is not enough with copying - # documentation entry files, it is also needed to update menu, - # nodes and related cross-references). - for MANUAL_ENTRY in ${MANUAL_ENTRIES};do - - # Define menu file based on manual entry. We use the menu file - # as reference to build the nodes files and update the menu - # file itself based on available section files. - local MENUFILE=$(dirname ${MANUAL_ENTRY} \ - | sed -r 's,/$,,')-menu.${MANUAL_EXTENSION} - - # Don't print action name here. Instead, make it integral part - # of documentation entry creation process. - #cli_printMessage "${MANUAL_ENTRY}" --as-stdout-line - - ${ACTIONNAM_SECMENU} - texinfo_updateSectionNodes - texinfo_makeSeeAlso "${MANUAL_ENTRY}" - ${ACTIONNAM_CROSREF} "${MANUAL_ENTRY}" - - done - -} diff --git a/Automation/Modules/Help/help.sh b/Automation/Modules/Help/help.sh deleted file mode 100755 index 1d7df06..0000000 --- a/Automation/Modules/Help/help.sh +++ /dev/null @@ -1,213 +0,0 @@ -#!/bin/bash -# -# help.sh -- This function initializes the interface used by -# centos-art.sh script to perform documentation tasks through -# different documentation formats. -# -# Copyright (C) 2009-2013 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 help { - - # Initialize action name with an empty value. - local ACTIONNAM='' - - # Initialize search option (`--search'). This option is used to - # look for documentation inside documentation formats. - local FLAG_SEARCH="" - - # Initialize manual's language. - local MANUAL_L10N=${CLI_LANG_LC} - - # Initialize manuals' top-level directory. This is the place where - # source files for documentation manuals will be stored in. - local MANUAL_TLDIR="${TCAR_WORKDIR}/Documentation/Models" - - # Initialize documentation format. This information defines the - # kind of source files we work with inside the documentation - # manual as well as the kind of actions required by them to - # perform actions related to document management (e.g., creation, - # edition, deletion, copying, renaming, etc.). By default texinfo - # format is used. Other formats can be specified in the - # command-line using the `--format' option. - local FLAG_FORMAT='texinfo' - - # Initialize specific function export id. This value is redefined - # later once we know which is the documentation format. - local EXPORTID='' - - # Initialize documentation entries arrays. Arrays defined here - # contain all the information needed to process documentation - # entries (e.g., manual, part, chapter and section). - local -a MANUAL_SLFN - local -a MANUAL_DIRN - local -a MANUAL_PART - local -a MANUAL_CHAP - local -a MANUAL_SECT - - # Initialize documentation entries counter. - local MANUAL_DOCENTRY_COUNT=0 - local MANUAL_DOCENTRY_ID=0 - - # Interpret option arguments passed through the command-line. - help_getOptions - - # Redefine arrays related to documentation entries using - # non-option arguments passed through the command-line. At this - # point all options have been removed from ARGUMENTS and - # non-option arguments remain. Evaluate ARGUMENTS to retrieve the - # information related documentation entries from there. - help_getEntries - - # Execute format-specific documentation tasks for each - # documentation entry specified in the command-line, individually. - # Notice that we've stored all documentation entries passed as - # non-option arguments in array variables in order to process them - # now, one by one. This is particularly useful when we need to - # reach items in the array beyond the current iteration cycle. For - # example, when we perform actions that require source and target - # locations (e.g., copying and renaming): we use the current value - # as source location and the second value in the array as target - # location; both defined from the first iteration cycle. - while [[ $MANUAL_DOCENTRY_ID -lt $MANUAL_DOCENTRY_COUNT ]];do - - # Define name used by manual's main definition file. - MANUAL_NAME=${MANUAL_SLFN[${MANUAL_DOCENTRY_ID}]} - - # Define extension used by documentation manuals. The - # extension used must be the same passed in the format option. - MANUAL_EXTENSION=${FLAG_FORMAT} - - # Define absolute path to directory holding language-specific - # models. - MANUAL_BASEDIR="${MANUAL_TLDIR}/$(cli_getRepoName \ - ${MANUAL_EXTENSION} -d)/${MANUAL_DIRN[${MANUAL_DOCENTRY_ID}]}" - - # Define absolute path to directory holding language-specific - # source files. - MANUAL_BASEDIR_L10N="${MANUAL_BASEDIR}/${MANUAL_L10N}" - - # Define absolute path to changed directories inside the - # manual. For example, when a section entry is edited, copied - # or renamed inside the same manual there is only one - # absolute path to look for changes, the one holding the - # section entry. However, when an entire manual is renamed, - # there might be two different locations to look changes for, - # the source location deleted and the target location added. - MANUAL_CHANGED_DIRS="${MANUAL_BASEDIR_L10N}" - - # Define absolute path to base file. This is the main file - # name (without extension) we use as reference to build output - # files in different formats (.info, .pdf, .xml, etc.). - MANUAL_BASEFILE="${MANUAL_BASEDIR_L10N}/${MANUAL_NAME}" - - # Redefine function export id based on documentation format. - EXPORTID="${CLI_FUNCDIRNAM}/$(cli_getRepoName ${MANUAL_EXTENSION} -d)/${MANUAL_EXTENSION}" - - # Define manual base file used for output. - MANUAL_OUTPUT_BASEFILE=$(echo $MANUAL_BASEFILE | sed -r 's!Models/!Manuals/!') - - # Define manual's part name. - MANUAL_PART_NAME=${MANUAL_PART[${MANUAL_DOCENTRY_ID}]} - - # Define absolute path to manual's part directory. - MANUAL_PART_DIR="${MANUAL_BASEDIR_L10N}/${MANUAL_PART_NAME}" - - # Define manual's chapter name. - MANUAL_CHAPTER_NAME=${MANUAL_CHAP[${MANUAL_DOCENTRY_ID}]} - - # Define absolute path to chapter's directory. This is the - # place where chapter-specific files are stored in. Be sure no - # extra slash be present in the value (e.g., when the part - # name isn't provided). - MANUAL_CHAPTER_DIR="$(echo ${MANUAL_PART_DIR}/${MANUAL_CHAPTER_NAME} \ - | sed -r 's!/{2,}!/!g' | sed -r 's!/$!!' )" - - # Define section name. - MANUAL_SECTION_NAME=${MANUAL_SECT[${MANUAL_DOCENTRY_ID}]} - - # Define absolute path to manual's configuration file. This - # is the file that controls the way template files are applied - # to documentation entries once they have been created as well - # as the style and order used for printing sections. - MANUAL_CONFIG_FILE="${MANUAL_BASEFILE}.conf" - - # Notice that, because we are processing non-option arguments - # one by one, there is no need to synchronize changes or - # initialize functionalities to the same manual time after - # time (assuming all documentation entries passed as - # non-option arguments refer the same manual directory name). - # That would be only necessary when documentation entries - # refer to different manual directory names that could be - # written in different documentation formats. - if [[ ${MANUAL_DOCENTRY_ID} -eq 0 \ - || ( ( ${MANUAL_DOCENTRY_ID} -gt 0 ) && ( \ - ${MANUAL_DIRN[${MANUAL_DOCENTRY_ID}]} != ${MANUAL_DIRN[((${MANUAL_DOCENTRY_ID} - 1))]} ) ) ]];then - - # Synchronize 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. - if [[ -d ${MANUAL_CHANGED_DIRS} ]];then - cli_synchronizeRepoChanges "${MANUAL_CHANGED_DIRS}" - fi - - # Initialize documentation format functionalities. At - # this point we load all functionalities required into - # `centos-art.sh''s execution environment and make them - # available, this way, to perform format-specific - # documentation tasks. - cli_exportFunctions "${EXPORTID}" - - fi - - # Execute format-specific documentation tasks. - ${MANUAL_EXTENSION} - - # Unset the exported functions before go on with the next - # documentation entry provided as non-option argument to - # `centos-art.sh' script. Different documentation entries may - # be written in different documentation formats. Each - # documentation format is loaded in order to perform their - # related documentation tasks. Assuming more that one - # documentation entry be passed as non-option argument to - # `centos-art.sh' script and they are written in different - # formats, we might end up loading documentation format - # functionalities that aren't used in the current - # documentation entry being processed. In that sake, unset - # documentation back-end functionalities when the next - # documentation entry refers to a manual directory different - # to that one being currently processed. - if [[ ${MANUAL_DOCENTRY_ID} -gt 0 \ - && ${MANUAL_DIRN[${MANUAL_DOCENTRY_ID}]} != ${MANUAL_DIRN[((${MANUAL_DOCENTRY_ID} + 1))]} ]];then - cli_unsetFunctions "${EXPORTID}" - fi - - # Increment documentation entry counter id. - MANUAL_DOCENTRY_ID=$(($MANUAL_DOCENTRY_ID + 1)) - - done - - # Synchronize 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_synchronizeRepoChanges "${MANUAL_CHANGED_DIRS}" - -} diff --git a/Automation/Modules/Help/help_getEntries.sh b/Automation/Modules/Help/help_getEntries.sh deleted file mode 100755 index 56e1a92..0000000 --- a/Automation/Modules/Help/help_getEntries.sh +++ /dev/null @@ -1,125 +0,0 @@ -#!/bin/bash -# -# help_getEntries.sh -- This function interpretes non-option -# arguments passed to `help' functionality through the command-line -# and redefines array variables related to documentation entries. -# -# Copyright (C) 2009-2013 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 help_getEntries { - - # Initialize manual's documentation entry as an empty value local - # to this function. - local MANUAL_DOCENTRY='' - - # Redefine positional parameters using ARGUMENTS. At this point, - # option arguments have been removed from ARGUMENTS variable and - # only non-option arguments remain in it. - eval set -- "$ARGUMENTS" - - # Retrive documentation entries passed to `centos-art.sh' script - # as non-option arguments and store them in array variables in - # order to describe their parts (e.g., manual name, chapter name - # and section name) that way. Documentation entries passed as - # non-opiton arguments must be written either in - # `MANUAL:PART:CHAPTER:SECTION' or `path/to/dir' formats in order - # to be processed correctly here. Empty spaces are not permitted. - # To separate words, use the minus sign (e.g., hello-world) or - # cammel case (e.g., HelloWorld). - for MANUAL_DOCENTRY in $@;do - - if [[ ${MANUAL_DOCENTRY} =~ '^[[:alpha:]][[:alnum:]-]+:([[:alnum:]-]*:){2}[[:alnum:]/]*' ]];then - - # When `MANUAL:PART:CHAPTER:SECTION' is used as format to - # documentation entry, you can specify the manual, chapter - # and section where documentation actions will take place - # on. - - # Manual self name. - MANUAL_SLFN[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ - $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN { FS=":" } { print $1 }') -f \ - | tr '[:upper:]' '[:lower:]') - - # Manual self directory name. - MANUAL_DIRN[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ - $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN { FS=":" } { print $1 }') -d ) - - # Manual part name. - MANUAL_PART[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ - $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN { FS=":" } { print $2 }') -d ) - - # Manual chapter name. - MANUAL_CHAP[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ - $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN { FS=":" } { print $3 }') -d ) - - # Manual section name. - MANUAL_SECT[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ - $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN { FS=":" } { print $4 }' | tr '/' '-') -f ) - - elif [[ ${MANUAL_DOCENTRY} =~ "^(trunk|branches|tags)?(/)?($(ls ${TCAR_WORKDIR} \ - | tr '[[:space:]]' '|' | sed 's/|$//'))" ]];then - - # When we use the `path/to/dir' as format to reach - # documentation entries, you cannot specify the manual - # chapter or section where documentation actions will take - # place on. Instead, they are predefined for you here. Use - # this format to quickly document directories inside your - # working copy. - # - # When we use the `path/to/dir' format to reach - # documentation entries, there is a distinction between - # Subversion and Git version control system we need to be - # aware of. This is the directory structure layout used - # in the repository. In Subversion, we use a trunk/, - # branches/, tags/ layout as first level in the repository - # directory structure but, in Git, we don't need such - # special layout in the repository's first directory - # level. The script must be able to understand both - # directory structures. - - # Manual's self name. - MANUAL_SLFN[${MANUAL_DOCENTRY_COUNT}]='tcar-fs' - - # Manual's self directory name. - MANUAL_DIRN[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ - ${MANUAL_SLFN[${MANUAL_DOCENTRY_COUNT}]} -d) - - # Manual's chapter name. - MANUAL_CHAP[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ - $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN { FS="/" }; { if ( NF >= 1 ) print $1 }' ) -d ) - - # Manual's section name. - MANUAL_SECT[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ - $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN { FS="/" }; { if ( NF >= 2 ) print $0 }' \ - | cut -d/ -f2- | tr '/' '-') -f ) - - else - - cli_printMessage "`gettext "The documentation entry provided isn't supported."`" --as-error-line - - fi - - # Increment counting of non-option arguments. - MANUAL_DOCENTRY_COUNT=$(($MANUAL_DOCENTRY_COUNT + 1)) - - done - -} diff --git a/Automation/Modules/Help/help_getOptions.sh b/Automation/Modules/Help/help_getOptions.sh deleted file mode 100755 index 0ac28ec..0000000 --- a/Automation/Modules/Help/help_getOptions.sh +++ /dev/null @@ -1,138 +0,0 @@ -#!/bin/bash -# -# help_getOptions.sh -- This function interpretes option arguments -# passed to `help' functionality through the command-line and defines -# action names accordingly. -# -# Copyright (C) 2009-2013 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 help_getOptions { - - # Define short options we want to support. - local ARGSS="h,q" - - # Define long options we want to support. - local ARGSL="help,quiet,answer-yes,read,search:,format:,edit,update-output,update-structure,copy,delete,rename,synchronize" - - # Redefine ARGUMENTS using getopt(1) command parser. - cli_parseArguments - - # Reset positional parameters using output from (getopt) argument - # parser. - eval set -- "$ARGUMENTS" - - # Define action to take for each option passed. - while true; do - case "$1" in - - -h | --help ) - cli_runFnEnvironment help --read --format="texinfo" "tcar-fs::scripts:bash-functions-help" - shift 1 - exit - ;; - - -q | --quiet ) - FLAG_QUIET="true" - shift 1 - ;; - - --answer-yes ) - FLAG_ANSWER="true" - shift 1 - ;; - - --synchronize ) - FLAG_SYNCHRONIZE="true" - shift 1 - ;; - - --search ) - ACTIONNAM="searchIndex" - FLAG_SEARCH="$2" - shift 2 - ;; - - --format ) - FLAG_FORMAT=$(cli_getRepoName "$2" -f) - # Verify supported documentation manual formats. This - # is required in order to prevent building paths to - # non-existent documentation structures. - if [[ ! $FLAG_FORMAT =~ '^(texinfo)$' ]];then - cli_printMessage "`gettext "The documentation format provided is not supported."`" --as-error-line - fi - shift 2 - ;; - - --read ) - ACTIONNAM="searchNode" - shift 1 - ;; - - --edit ) - ACTIONNAM="editEntry" - shift 1 - ;; - - --copy ) - ACTIONNAM="copyEntry" - shift 1 - ;; - - --delete ) - ACTIONNAM="deleteEntry" - shift 1 - ;; - - --rename ) - ACTIONNAM="renameEntry" - shift 1 - ;; - - --update-output ) - ACTIONNAM="updateOutputFiles" - shift 1 - ;; - - --update-structure ) - ACTIONNAM="updateStructureSection" - shift 1 - ;; - - -- ) - # Remove the `--' argument from the list of arguments - # in order for processing non-option arguments - # correctly. At this point all option arguments have - # been processed already but the `--' argument still - # remains to mark ending of option arguments and - # beginning of non-option arguments. The `--' argument - # needs to be removed here in order to avoid - # centos-art.sh script to process it as a path inside - # the repository, which obviously is not. - shift 1 - break - ;; - esac - done - - # Redefine ARGUMENTS variable using current positional parameters. - cli_parseArgumentsReDef "$@" - -}