From 9fa13b8c2c0e71f93934448794d99d354e62373d Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Jun 12 2011 02:48:05 +0000 Subject: Update directory structure of `help' functionality. --- diff --git a/Scripts/Functions/Help/help.sh b/Scripts/Functions/Help/help.sh index d02bdc6..3fbb7ee 100755 --- a/Scripts/Functions/Help/help.sh +++ b/Scripts/Functions/Help/help.sh @@ -37,6 +37,9 @@ function help { # Define file name (without extension) for documentation manual. MANUAL_NAME=$(cli_getRepoName "repository" -f) + # Define file extension used by documentation manual source files. + MANUAL_EXTENSION='texinfo' + # Define language information used by manual. MANUAL_LANG=$(cli_getCurrentLocale) diff --git a/Scripts/Functions/Help/help_copyEntry.sh b/Scripts/Functions/Help/help_copyEntry.sh index 9c76505..266618e 100755 --- a/Scripts/Functions/Help/help_copyEntry.sh +++ b/Scripts/Functions/Help/help_copyEntry.sh @@ -39,11 +39,11 @@ function texinfo_copyEntry { # Define source documentation entry. This is the documentation # entry that will be duplicated. - local MANUAL_ENTRY_SRC=$(${FLAG_BACKEND}_getEntry "${1}") + local MANUAL_ENTRY_SRC=$(${FUNCNAM}_getEntry "${1}") # Define target documentation entry. This is the new documentation # entry created from the source documentation entry. - local MANUAL_ENTRY_DST=$(${FLAG_BACKEND}_getEntry "${2}") + local MANUAL_ENTRY_DST=$(${FUNCNAM}_getEntry "${2}") # Verify parent directory of target documentation entry. If it # doesn't exist, create it and add it to version control. @@ -66,8 +66,8 @@ function texinfo_copyEntry { # Redefine both source and target locations to refer the directory # where dependent documentation entries are stored in. - MANUAL_ENTRY_SRC=$(echo ${MANUAL_ENTRY_SRC} | sed -r "s/\.${FLAG_BACKEND}$//") - MANUAL_ENTRY_DST=$(echo ${MANUAL_ENTRY_DST} | sed -r "s/\.${FLAG_BACKEND}$//") + MANUAL_ENTRY_SRC=$(echo ${MANUAL_ENTRY_SRC} | sed -r "s/\.${MANUAL_EXTENSION}$//") + MANUAL_ENTRY_DST=$(echo ${MANUAL_ENTRY_DST} | sed -r "s/\.${MANUAL_EXTENSION}$//") # Copy dependent documentation entries, if any. if [[ -d ${MANUAL_ENTRY_SRC} ]];then @@ -81,7 +81,7 @@ function texinfo_copyEntry { local MANUAL_ENTRY='' local MANUAL_ENTRIES=$(cli_getFilesList \ $(dirname ${MANUAL_ENTRY_DST}) \ - --pattern="${MANUAL_ENTRY_DST}.*\.${FLAG_BACKEND}") + --pattern="${MANUAL_ENTRY_DST}.*\.${MANUAL_EXTENSION}") # Print separator line. cli_printMessage '-' --as-separator-line @@ -97,12 +97,12 @@ function texinfo_copyEntry { # Update menu and node definitions from manual sections to # reflect the changes. - ${FLAG_BACKEND}_updateMenu - ${FLAG_BACKEND}_updateNodes + ${FUNCNAM}_updateMenu + ${FUNCNAM}_updateNodes # Update cross reference definitions from manual to reflect # the changes. - ${FLAG_BACKEND}_restoreCrossReferences $MANUAL_ENTRY + ${FUNCNAM}_restoreCrossReferences $MANUAL_ENTRY done diff --git a/Scripts/Functions/Help/help_createChapters.sh b/Scripts/Functions/Help/help_createChapters.sh index 4bfe101..5fb89e0 100755 --- a/Scripts/Functions/Help/help_createChapters.sh +++ b/Scripts/Functions/Help/help_createChapters.sh @@ -60,7 +60,7 @@ function texinfo_createChapters { # file. The node structure of `Directories' chapter is created # automatically based on repository directory structure. if [[ $FILE =~ "Directories/chapter-nodes\.texinfo$" ]];then - echo "" > ${MANUAL_BASEDIR}/${MANUAL_CHAPTER_NAME}/chapter-nodes.${FLAG_BACKEND} + echo "" > ${MANUAL_BASEDIR}/${MANUAL_CHAPTER_NAME}/chapter-nodes.${MANUAL_EXTENSION} fi done diff --git a/Scripts/Functions/Help/help_createStructure.sh b/Scripts/Functions/Help/help_createStructure.sh index 443564a..bac1c23 100755 --- a/Scripts/Functions/Help/help_createStructure.sh +++ b/Scripts/Functions/Help/help_createStructure.sh @@ -45,7 +45,7 @@ function texinfo_createStructure { local FILE='' local FILES=$(cli_getFilesList "${MANUAL_TEMPLATE}" \ --maxdepth='1' \ - --pattern="repository(-menu|-nodes|-index)?\.${FLAG_BACKEND}") + --pattern="repository(-menu|-nodes|-index)?\.${MANUAL_EXTENSION}") # Verify manual base file. The manual base file is where the # documentation manual is defined in the backend format. Assuming @@ -60,14 +60,14 @@ function texinfo_createStructure { done # Update manual chapter related files. - ${FLAG_BACKEND}_createChapters + ${FUNCNAM}_createChapters # Update manual chapter related menu. - ${FLAG_BACKEND}_updateChaptersMenu + ${FUNCNAM}_updateChaptersMenu # Update manual chapter related nodes (based on chapter related # menu). - ${FLAG_BACKEND}_updateChaptersNodes + ${FUNCNAM}_updateChaptersNodes # Commit changes from working copy to central repository only. At # this point, changes in the repository are not merged in the diff --git a/Scripts/Functions/Help/help_deleteCrossReferences.sh b/Scripts/Functions/Help/help_deleteCrossReferences.sh index 5cfd3e7..4d55858 100755 --- a/Scripts/Functions/Help/help_deleteCrossReferences.sh +++ b/Scripts/Functions/Help/help_deleteCrossReferences.sh @@ -42,7 +42,7 @@ function texinfo_deleteCrossReferences { fi # Build the node string using entry location. - local NODE=$(${FLAG_BACKEND}_getNode "$MANUAL_ENTRY") + local NODE=$(${FUNCNAM}_getNode "$MANUAL_ENTRY") # Define regular expression patterns for texinfo cross reference # commands. @@ -62,7 +62,8 @@ function texinfo_deleteCrossReferences { REPLACE[1]='@comment --- '`gettext "Removed"`'(\1) ---' # Define list of entries to process. - local MANUAL_ENTRIES=$(cli_getFilesList ${MANUAL_BASEDIR} --pattern=".*\.${FLAG_BACKEND}") + local MANUAL_ENTRIES=$(cli_getFilesList ${MANUAL_BASEDIR} \ + --pattern=".*\.${MANUAL_EXTENSION}") # Update node-related cross references. The node-related cross # reference definition, long ones specially, could require more diff --git a/Scripts/Functions/Help/help_deleteEntry.sh b/Scripts/Functions/Help/help_deleteEntry.sh index 1acb27e..ed57b4a 100755 --- a/Scripts/Functions/Help/help_deleteEntry.sh +++ b/Scripts/Functions/Help/help_deleteEntry.sh @@ -31,7 +31,7 @@ function texinfo_deleteEntry { # Define list of entries to remove using the entry specified in # the command line. - local MANUAL_ENTRIES=$(${FLAG_BACKEND}_getEntry "$@") + local MANUAL_ENTRIES=$(${FUNCNAM}_getEntry "$@") # Print separator line. cli_printMessage '-' --as-separator-line @@ -43,19 +43,22 @@ function texinfo_deleteEntry { # Define directory where dependent documentation entries are # stored in. - MANUAL_ENTRY_DIR=$(echo $MANUAL_ENTRY | sed -r "s/\.${FLAG_BACKEND}$//") + MANUAL_ENTRY_DIR=$(echo $MANUAL_ENTRY \ + | sed -r "s/\.${MANUAL_EXTENSION}$//") if [[ -d $MANUAL_ENTRY_DIR ]];then # Add dependent documentation entries to the list of # documentation entries that will be deleted. - MANUAL_ENTRIES="${MANUAL_ENTRIES} $(cli_getFilesList ${MANUAL_ENTRY_DIR} --pattern=".*\.${FLAG_BACKEND}")" + MANUAL_ENTRIES="${MANUAL_ENTRIES} $(cli_getFilesList ${MANUAL_ENTRY_DIR} \ + --pattern=".*\.${MANUAL_EXTENSION}")" for MANUAL_ENTRY in $MANUAL_ENTRIES;do # Define directory name for dependent documentation # entries which have their own dependent directories. - MANUAL_ENTRY_SUBDIR=$(basename $MANUAL_ENTRY | sed -r "s/\.${FLAG_BACKEND}$//") + MANUAL_ENTRY_SUBDIR=$(basename $MANUAL_ENTRY \ + | sed -r "s/\.${MANUAL_EXTENSION}$//") # Add directory paths from dependent documentation # entries which have their own dependent directories @@ -116,18 +119,18 @@ function texinfo_deleteEntry { # Skip all directories, they are not documentation entries on # themselves. Use documentation entries only. - if [[ ! $MANUAL_ENTRY =~ "\.${FLAG_BACKEND}$" ]];then + if [[ ! $MANUAL_ENTRY =~ "\.${MANUAL_EXTENSION}$" ]];then continue fi # Update menu and node definitions from manual sections to # reflect the changes. - ${FLAG_BACKEND}_updateMenu "remove-entry" - ${FLAG_BACKEND}_updateNodes + ${FUNCNAM}_updateMenu "remove-entry" + ${FUNCNAM}_updateNodes # Update cross reference definitions from manual to reflect # the changes. - ${FLAG_BACKEND}_deleteCrossReferences $MANUAL_ENTRY + ${FUNCNAM}_deleteCrossReferences $MANUAL_ENTRY done diff --git a/Scripts/Functions/Help/help_editEntry.sh b/Scripts/Functions/Help/help_editEntry.sh index e32a01b..714b25b 100755 --- a/Scripts/Functions/Help/help_editEntry.sh +++ b/Scripts/Functions/Help/help_editEntry.sh @@ -49,11 +49,11 @@ function texinfo_editEntry { cli_printMessage "`gettext "Do you want to continue?"`" --as-yesornorequest-line # Update chapter section related menu. - ${FLAG_BACKEND}_updateMenu + ${FUNCNAM}_updateMenu # Update chapter section related nodes (based on chapter # section related menu). - ${FLAG_BACKEND}_updateNodes + ${FUNCNAM}_updateNodes # Update old missing cross references. If for some reason a # documentation entry is removed by mistake, and that mistake @@ -61,7 +61,7 @@ function texinfo_editEntry { # into the repository, rebuild the missing cross reference # message to use the correct link to the documentation # section. - ${FLAG_BACKEND}_restoreCrossReferences $MANUAL_ENTRY + ${FUNCNAM}_restoreCrossReferences $MANUAL_ENTRY else diff --git a/Scripts/Functions/Help/help_getChapterDir.sh b/Scripts/Functions/Help/help_getChapterDir.sh index a2edcf7..44a8a88 100755 --- a/Scripts/Functions/Help/help_getChapterDir.sh +++ b/Scripts/Functions/Help/help_getChapterDir.sh @@ -40,7 +40,7 @@ function texinfo_getChapterDir { # their own files, they all will be written inside the same # section file that represents the repository documentation entry. for MANUAL_ENTRY in $MANUAL_ENTRIES;do - ${FLAG_BACKEND}_getEntry $MANUAL_ENTRY | cut -d / -f-8 + ${FUNCNAM}_getEntry $MANUAL_ENTRY | cut -d / -f-8 done | sort | uniq } diff --git a/Scripts/Functions/Help/help_getEntry.sh b/Scripts/Functions/Help/help_getEntry.sh index 174e0e5..bd8bcdc 100755 --- a/Scripts/Functions/Help/help_getEntry.sh +++ b/Scripts/Functions/Help/help_getEntry.sh @@ -56,11 +56,10 @@ function texinfo_getEntry { # documenting the repository directory structure. Otherwise, # if an entry inside trunk/Manuals/ is provided, the directory # structure provided is used as default documentation manual. - if [[ ${MANUAL_ENTRY} =~ "\.${FLAG_BACKEND}$" ]];then - MANUAL_ENTRY=$(echo ${MANUAL_ENTRY} \ - | sed "s!trunk/Manuals/RepoReference/!!") + if [[ ${MANUAL_ENTRY} =~ "\.${MANUAL_EXTENSION}$" ]];then + MANUAL_ENTRY=$(echo ${MANUAL_ENTRY} | sed "s!${MANUAL_BASEDIR}!!") else - MANUAL_ENTRY=$(dirname ${MANUAL_CHAPTER_NAME}/${MANUAL_ENTRY})/$(basename $LOCATION).${FLAG_BACKEND} + MANUAL_ENTRY=$(dirname ${MANUAL_CHAPTER_NAME}/${MANUAL_ENTRY})/$(basename $LOCATION).${MANUAL_EXTENSION} fi # Re-define entry to set absolute path to manuals base diff --git a/Scripts/Functions/Help/help_getNode.sh b/Scripts/Functions/Help/help_getNode.sh index 36f93f4..03bb857 100755 --- a/Scripts/Functions/Help/help_getNode.sh +++ b/Scripts/Functions/Help/help_getNode.sh @@ -36,7 +36,7 @@ function texinfo_getNode { # Define node from documentation entry. local NODE=$(echo "$MANUAL_ENTRY" | sed -r \ -e "s!^${MANUAL_BASEDIR}!!" \ - -e "s/(chapter-intro\.${FLAG_BACKEND}|\.${FLAG_BACKEND})$//" \ + -e "s/(chapter-intro\.${MANUAL_EXTENSION}|\.${MANUAL_EXTENSION})$//" \ -e 's!/! !g' \ -e 's!^[[:space:]]+!!') diff --git a/Scripts/Functions/Help/help_getOptions.sh b/Scripts/Functions/Help/help_getOptions.sh index 6f77319..abe58af 100755 --- a/Scripts/Functions/Help/help_getOptions.sh +++ b/Scripts/Functions/Help/help_getOptions.sh @@ -29,7 +29,7 @@ function help_getOptions { local ARGSS="" # Define long options we want to support. - local ARGSL="quiet,answer-yes,dont-commit-changes,read,search:,edit,update,copy,delete,rename,backend:" + local ARGSL="quiet,answer-yes,dont-commit-changes,read,search:,edit,update,copy,delete,rename" # Parse arguments using getopt(1) command parser. cli_parseArguments @@ -102,11 +102,6 @@ function help_getOptions { shift 1 ;; - --backend ) - FLAG_BACKEND=$(cli_getRepoName ${2} -f) - shift 2 - ;; - -- ) # Remove the `--' argument from the list of arguments # in order for processing non-option arguments diff --git a/Scripts/Functions/Help/help_renameCrossReferences.sh b/Scripts/Functions/Help/help_renameCrossReferences.sh index a2f687e..755d708 100755 --- a/Scripts/Functions/Help/help_renameCrossReferences.sh +++ b/Scripts/Functions/Help/help_renameCrossReferences.sh @@ -26,17 +26,18 @@ function texinfo_renameCrossReferences { - local MANUAL_ENTRY_SRC=$(${FLAG_BACKEND}_getEntry "$1") - local MANUAL_ENTRY_DST=$(${FLAG_BACKEND}_getEntry "$2") + local MANUAL_ENTRY_SRC=$(${FUNCNAM}_getEntry "$1") + local MANUAL_ENTRY_DST=$(${FUNCNAM}_getEntry "$2") # Define node pattern for source documenation entry. - local NODE_SRC=$(${FLAG_BACKEND}_getNode "$MANUAL_ENTRY_SRC") + local NODE_SRC=$(${FUNCNAM}_getNode "$MANUAL_ENTRY_SRC") # Define node replacement for target documentation entry. - local NODE_DST=$(${FLAG_BACKEND}_getNode "$MANUAL_ENTRY_DST") + local NODE_DST=$(${FUNCNAM}_getNode "$MANUAL_ENTRY_DST") # Define list of entries to process. - local MANUAL_ENTRIES=$(cli_getFilesList ${MANUAL_BASEDIR} --pattern=".*\.${FLAG_BACKEND}") + local MANUAL_ENTRIES=$(cli_getFilesList ${MANUAL_BASEDIR} \ + --pattern=".*\.${MANUAL_EXTENSION}") # Update node-related cross-references. The node-related cross # reference definition, long ones specially, could require more @@ -66,6 +67,6 @@ function texinfo_renameCrossReferences { # source to target documentation entry, but they are still # commented. So, uncomment them restoring target documentation # entries. - ${FLAG_BACKEND}_restoreCrossReferences "${MANUAL_ENTRY_DST}" + ${FUNCNAM}_restoreCrossReferences "${MANUAL_ENTRY_DST}" } diff --git a/Scripts/Functions/Help/help_renameEntry.sh b/Scripts/Functions/Help/help_renameEntry.sh index 09fff4a..c3335d9 100755 --- a/Scripts/Functions/Help/help_renameEntry.sh +++ b/Scripts/Functions/Help/help_renameEntry.sh @@ -26,17 +26,17 @@ function texinfo_renameEntry { # Copy source documentation entry. - ${FLAG_BACKEND}_copyEntry "$1" "$2" + ${FUNCNAM}_copyEntry "$1" "$2" # Delete source documentation entry. The source documentation # entry has been copied already, so to create the rename effect # delete it from repository filesystem. - ${FLAG_BACKEND}_deleteEntry "$1" + ${FUNCNAM}_deleteEntry "$1" # At this point, source documentation entry has been removed and # all menu, nodes and cross-references have been commented. So, # replace commented menu, nodes and cross-reference information # from source to target documentation entry. - ${FLAG_BACKEND}_renameCrossReferences "$1" "$2" + ${FUNCNAM}_renameCrossReferences "$1" "$2" } diff --git a/Scripts/Functions/Help/help_restoreCrossReferences.sh b/Scripts/Functions/Help/help_restoreCrossReferences.sh index 3b2b053..615079c 100755 --- a/Scripts/Functions/Help/help_restoreCrossReferences.sh +++ b/Scripts/Functions/Help/help_restoreCrossReferences.sh @@ -46,7 +46,7 @@ function texinfo_restoreCrossReferences { fi # Build the node string using entry location. - local NODE=$(${FLAG_BACKEND}_getNode "$MANUAL_ENTRY") + local NODE=$(${FUNCNAM}_getNode "$MANUAL_ENTRY") # Define regular expression patterns to match removed message # format produced by message_removeCrossReferences function. @@ -59,7 +59,8 @@ function texinfo_restoreCrossReferences { REPLACE[1]='\1' # Define list of entries to process. - local MANUAL_ENTRIES=$(cli_getFilesList ${MANUAL_BASEDIR} --pattern=".*\.${FLAG_BACKEND}") + local MANUAL_ENTRIES=$(cli_getFilesList ${MANUAL_BASEDIR} \ + --pattern=".*\.${MANUAL_EXTENSION}") # Update node-related cross references. The node-related cross # reference definition, long ones specially, could require more diff --git a/Scripts/Functions/Help/help_searchIndex.sh b/Scripts/Functions/Help/help_searchIndex.sh index 3d96c7a..536997d 100644 --- a/Scripts/Functions/Help/help_searchIndex.sh +++ b/Scripts/Functions/Help/help_searchIndex.sh @@ -26,7 +26,7 @@ function texinfo_searchIndex { # Rebuild output files to propagate recent changes. - ${FLAG_BACKEND}_updateOutputFiles + ${FUNCNAM}_updateOutputFiles # Print separator line. cli_printMessage '-' --as-separator-line diff --git a/Scripts/Functions/Help/help_searchNode.sh b/Scripts/Functions/Help/help_searchNode.sh index 2a28295..ae0a811 100755 --- a/Scripts/Functions/Help/help_searchNode.sh +++ b/Scripts/Functions/Help/help_searchNode.sh @@ -30,7 +30,7 @@ function texinfo_searchNode { # Define list of documentation entries. local MANUAL_ENTRY='' - local MANUAL_ENTRIES=$(${FLAG_BACKEND}_getEntry "$@") + local MANUAL_ENTRIES=$(${FUNCNAM}_getEntry "$@") # Loop through manual entries and read related node. for MANUAL_ENTRY in $MANUAL_ENTRIES;do @@ -43,9 +43,9 @@ function texinfo_searchNode { # the info file at the specified node for reading it on the # terminal. Otherwise, ask the user to create it. if [[ -f "$MANUAL_ENTRY" ]];then - /usr/bin/info --node="$(${FLAG_BACKEND}_getNode "$MANUAL_ENTRY")" --file=${MANUAL_BASEFILE}.info.bz2 + /usr/bin/info --node="$(${FUNCNAM}_getNode "$MANUAL_ENTRY")" --file=${MANUAL_BASEFILE}.info.bz2 else - ${FLAG_BACKEND}_editEntry + ${FUNCNAM}_editEntry fi done diff --git a/Scripts/Functions/Help/help_updateChaptersMenu.sh b/Scripts/Functions/Help/help_updateChaptersMenu.sh index 2fd2f40..0751e8b 100755 --- a/Scripts/Functions/Help/help_updateChaptersMenu.sh +++ b/Scripts/Functions/Help/help_updateChaptersMenu.sh @@ -32,8 +32,8 @@ function texinfo_updateChaptersMenu { # 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.${FLAG_BACKEND} ]];then - MENUCHAPTERS=$(cat ${MANUAL_BASEFILE}-menu.${FLAG_BACKEND} \ + if [[ -f ${MANUAL_BASEFILE}-menu.${MANUAL_EXTENSION} ]];then + MENUCHAPTERS=$(cat ${MANUAL_BASEFILE}-menu.${MANUAL_EXTENSION} \ | egrep -v "^@(end )?menu$" | egrep -v '^\* Index::$') fi @@ -74,6 +74,6 @@ function texinfo_updateChaptersMenu { | egrep -v '^[[:space:]]*$') # Dump organized menu of chapters into file. - echo "${MENUCHAPTERS}" > ${MANUAL_BASEFILE}-menu.${FLAG_BACKEND} + echo "${MENUCHAPTERS}" > ${MANUAL_BASEFILE}-menu.${MANUAL_EXTENSION} } diff --git a/Scripts/Functions/Help/help_updateChaptersNodes.sh b/Scripts/Functions/Help/help_updateChaptersNodes.sh index 18541a6..8afff29 100755 --- a/Scripts/Functions/Help/help_updateChaptersNodes.sh +++ b/Scripts/Functions/Help/help_updateChaptersNodes.sh @@ -26,7 +26,7 @@ function texinfo_updateChaptersNodes { # Build list "nodes of chapters" based on menu of chapters. - local CHAPTERNODES=$(cat ${MANUAL_BASEFILE}-menu.${FLAG_BACKEND} \ + local CHAPTERNODES=$(cat ${MANUAL_BASEFILE}-menu.${MANUAL_EXTENSION} \ | egrep -v '^@(end )?menu$' | egrep -v '^\* Index::$'\ | sed -r 's!^\* !!' | sed -r 's!::[[:print:]]*$!!g' \ | sed -r 's! !_!g' | sort | uniq ) @@ -37,12 +37,12 @@ function texinfo_updateChaptersNodes { local FILENODE=$(\ for CHAPTERNODE in ${CHAPTERNODES};do INCL=$(echo ${CHAPTERNODE} \ - | sed -r "s!(${CHAPTERNODE})!\1/chapter\.${FLAG_BACKEND}!") + | sed -r "s!(${CHAPTERNODE})!\1/chapter\.${MANUAL_EXTENSION}!") # Output inclusion line using texinfo format. echo "@include $INCL" done) # Dump organized nodes of chapters into file. - echo "$FILENODE" > ${MANUAL_BASEFILE}-nodes.${FLAG_BACKEND} + echo "$FILENODE" > ${MANUAL_BASEFILE}-nodes.${MANUAL_EXTENSION} } diff --git a/Scripts/Functions/Help/help_updateMenu.sh b/Scripts/Functions/Help/help_updateMenu.sh index 874660d..c7591df 100755 --- a/Scripts/Functions/Help/help_updateMenu.sh +++ b/Scripts/Functions/Help/help_updateMenu.sh @@ -36,14 +36,14 @@ function texinfo_updateMenu { # Build the menu node related to the entry being processed # currently. - local MENUNODE=$(${FLAG_BACKEND}_getNode "$MANUAL_ENTRY") + local MENUNODE=$(${FUNCNAM}_getNode "$MANUAL_ENTRY") # Give format to menu line using texinfo style. local MENULINE="* ${MENUNODE}::" # Define chapter's menu. Remove `@menu', `@end menu' and empty # lines from output. - local MENU=$(cat $MANUAL_CHAPTER_DIR/chapter-menu.${FLAG_BACKEND} \ + local MENU=$(cat $MANUAL_CHAPTER_DIR/chapter-menu.${MANUAL_EXTENSION} \ | egrep -v '^[[:space:]]*$' | egrep -v '^@(end )?menu') # Re-defined chapter's menu based on action. @@ -78,6 +78,6 @@ function texinfo_updateMenu { MENU=$(echo "$MENU" | sed -r 's!^[[:space:]]+!!g') # Dump final menu structure back into chapter's menu file. - echo "$MENU" > $MANUAL_CHAPTER_DIR/chapter-menu.${FLAG_BACKEND} + echo "$MENU" > $MANUAL_CHAPTER_DIR/chapter-menu.${MANUAL_EXTENSION} } diff --git a/Scripts/Functions/Help/help_updateNodes.sh b/Scripts/Functions/Help/help_updateNodes.sh index 4ac333a..71c7520 100755 --- a/Scripts/Functions/Help/help_updateNodes.sh +++ b/Scripts/Functions/Help/help_updateNodes.sh @@ -26,7 +26,7 @@ function texinfo_updateNodes { # Retrive nodes' entries from chapter-menu.texinfo file. - local NODES=$(cat $MANUAL_CHAPTER_DIR/chapter-menu.${FLAG_BACKEND} \ + local NODES=$(cat $MANUAL_CHAPTER_DIR/chapter-menu.${MANUAL_EXTENSION} \ | sed -r 's!^\* !!' | sed -r 's!:{1,2}.*$!!g' \ | egrep -v '^@(end )?menu$' | sed -r 's! !:!g' | sort | uniq) @@ -35,7 +35,7 @@ function texinfo_updateNodes { NODE=$(echo "${NODE}" | sed -r 's!:! !g') SECT=$(echo "${NODE}" | cut -d' ' -f2- | sed -r 's! !/!g') - INCL=$(echo "${NODE}" | sed -r 's! !/!g').${FLAG_BACKEND} + INCL=$(echo "${NODE}" | sed -r 's! !/!g').${MANUAL_EXTENSION} CIND=$(echo "${NODE}") # Create texinfo section file using templates, only if the @@ -112,22 +112,22 @@ function texinfo_updateNodes { # Expand `See also' subsection translation markers in # documentation entry. - ${FLAG_BACKEND}_makeSeeAlso "${MANUAL_BASEDIR}/$INCL" "$NODE" + ${FUNCNAM}_makeSeeAlso "${MANUAL_BASEDIR}/$INCL" "$NODE" fi # Verify existence of chapter-nodes template files. If no # chapter-nodes template is found, stop script execution with # an error message. We cannot continue without it. - cli_checkFiles ${MANUAL_TEMPLATE}/${MANUAL_CHAPTER_NAME}/chapter-nodes.${FLAG_BACKEND} + cli_checkFiles ${MANUAL_TEMPLATE}/${MANUAL_CHAPTER_NAME}/chapter-nodes.${MANUAL_EXTENSION} # Output node information chapter-nodes template file using # the current texinfo menu information. - cat ${MANUAL_TEMPLATE}/${MANUAL_CHAPTER_NAME}/chapter-nodes.${FLAG_BACKEND} \ + cat ${MANUAL_TEMPLATE}/${MANUAL_CHAPTER_NAME}/chapter-nodes.${MANUAL_EXTENSION} \ | sed -r -e "s!=NODE=!${NODE}!g" -e "s!=SECT=!${SECT}!g" \ -e "s!=CIND=!${CIND}!g" -e "s!=INCL=!${INCL}!g" # Dump node definitions into document structure. - done > $MANUAL_CHAPTER_DIR/chapter-nodes.${FLAG_BACKEND} + done > $MANUAL_CHAPTER_DIR/chapter-nodes.${MANUAL_EXTENSION} } diff --git a/Scripts/Functions/Help/help_updateOutputFileInfo.sh b/Scripts/Functions/Help/help_updateOutputFileInfo.sh index a8ea1ad..b448817 100755 --- a/Scripts/Functions/Help/help_updateOutputFileInfo.sh +++ b/Scripts/Functions/Help/help_updateOutputFileInfo.sh @@ -31,7 +31,7 @@ function texinfo_updateOutputFileInfo { # Update info file. /usr/bin/makeinfo --output=${MANUAL_BASEFILE}.info \ --enable-encoding \ - ${MANUAL_BASEFILE}.${FLAG_BACKEND} + ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} # Compress info file. if [[ $? -eq 0 ]];then diff --git a/Scripts/Functions/Help/help_updateOutputFilePdf.sh b/Scripts/Functions/Help/help_updateOutputFilePdf.sh index 8997007..6a9898e 100755 --- a/Scripts/Functions/Help/help_updateOutputFilePdf.sh +++ b/Scripts/Functions/Help/help_updateOutputFilePdf.sh @@ -30,6 +30,6 @@ function texinfo_updateOutputFilePdf { # Update plaintext output directory. /usr/bin/texi2pdf --quiet \ - ${MANUAL_BASEFILE}.${FLAG_BACKEND} --output=${MANUAL_BASEFILE}.pdf + ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} --output=${MANUAL_BASEFILE}.pdf } diff --git a/Scripts/Functions/Help/help_updateOutputFilePlaintext.sh b/Scripts/Functions/Help/help_updateOutputFilePlaintext.sh index b2fbc52..5a707ee 100755 --- a/Scripts/Functions/Help/help_updateOutputFilePlaintext.sh +++ b/Scripts/Functions/Help/help_updateOutputFilePlaintext.sh @@ -30,7 +30,7 @@ function texinfo_updateOutputFilePlaintext { # Update plaintext output directory. /usr/bin/makeinfo --plaintext \ - ${MANUAL_BASEFILE}.${FLAG_BACKEND} --output=${MANUAL_BASEFILE}.txt + ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} --output=${MANUAL_BASEFILE}.txt # Compress plaintext output file. if [[ -f ${MANUAL_BASEFILE}.txt ]];then diff --git a/Scripts/Functions/Help/help_updateOutputFileXhtml.sh b/Scripts/Functions/Help/help_updateOutputFileXhtml.sh index 969f166..c4733ef 100755 --- a/Scripts/Functions/Help/help_updateOutputFileXhtml.sh +++ b/Scripts/Functions/Help/help_updateOutputFileXhtml.sh @@ -62,7 +62,7 @@ function texinfo_updateOutputFileXhtml { --init-file=${MANUAL_BACKEND}/${MANUAL_NAME}-init.pl \ --init-file=${MANUAL_TEMPLATE}/${MANUAL_NAME}-init.pl \ --output=${MANUAL_BASEDIR}/${MANUAL_NAME}.xhtml \ - ${MANUAL_BASEDIR}/${MANUAL_NAME}.${FLAG_BACKEND} + ${MANUAL_BASEDIR}/${MANUAL_NAME}.${MANUAL_EXTENSION} # Remove directory where xhtml files are stored from directory # stack. The xhtml files have been already created. diff --git a/Scripts/Functions/Help/help_updateOutputFileXml.sh b/Scripts/Functions/Help/help_updateOutputFileXml.sh index 4606b15..10191a2 100755 --- a/Scripts/Functions/Help/help_updateOutputFileXml.sh +++ b/Scripts/Functions/Help/help_updateOutputFileXml.sh @@ -30,6 +30,6 @@ function texinfo_updateOutputFileXml { # Update xml output format. /usr/bin/makeinfo --xml \ - ${MANUAL_BASEFILE}.${FLAG_BACKEND} --output=${MANUAL_BASEFILE}.xml \ + ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} --output=${MANUAL_BASEFILE}.xml \ } diff --git a/Scripts/Functions/Help/help_updateOutputFiles.sh b/Scripts/Functions/Help/help_updateOutputFiles.sh index beba642..64f4ac5 100755 --- a/Scripts/Functions/Help/help_updateOutputFiles.sh +++ b/Scripts/Functions/Help/help_updateOutputFiles.sh @@ -33,11 +33,11 @@ function texinfo_updateOutputFiles { # paths incorrectly. pushd ${HOME}/artwork > /dev/null - ${FLAG_BACKEND}_updateOutputFileInfo - ${FLAG_BACKEND}_updateOutputFileXhtml - ${FLAG_BACKEND}_updateOutputFileXml - ${FLAG_BACKEND}_updateOutputFilePdf - ${FLAG_BACKEND}_updateOutputFilePlaintext + ${FUNCNAM}_updateOutputFileInfo + ${FUNCNAM}_updateOutputFileXhtml + ${FUNCNAM}_updateOutputFileXml + ${FUNCNAM}_updateOutputFilePdf + ${FUNCNAM}_updateOutputFilePlaintext # Remove the working copy root directory from directory stack. popd > /dev/null