From 66b6ae92d8323d6b09bcfa772ecc6cbc3c26e781 Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: May 27 2011 03:42:23 +0000 Subject: Update `help' functionality: - Change file extension from `.texi' to ${FLAG_BACKEND} variable, inside Texinfo documentation backend. --- diff --git a/Scripts/Functions/Help/Backends/Texinfo/texinfo_copyEntry.sh b/Scripts/Functions/Help/Backends/Texinfo/texinfo_copyEntry.sh index 20c29cb..97ce4e1 100755 --- a/Scripts/Functions/Help/Backends/Texinfo/texinfo_copyEntry.sh +++ b/Scripts/Functions/Help/Backends/Texinfo/texinfo_copyEntry.sh @@ -47,7 +47,7 @@ function texinfo_copyEntry { # Define target location of directory holding dependent # documentation entries. - ENTRY_DST=$(echo ${ENTRY_DST} | sed -r 's!\.texi$!!') + ENTRY_DST=$(echo ${ENTRY_DST} | sed -r "s/\.${FLAG_BACKEND}$//") # Copy dependent documentation entries, if any. if [[ -d ${ENTRY_DIR}/${ENTRY_FILE} ]] && [[ ! -d ${ENTRY_DST} ]];then @@ -56,7 +56,7 @@ function texinfo_copyEntry { fi # Define list of files to process. - ENTRIES=$(cli_getFilesList $(dirname ${ENTRY_DST}) --pattern=".*$(basename ${ENTRY_DST}).*\.texi") + ENTRIES=$(cli_getFilesList $(dirname ${ENTRY_DST}) --pattern=".*$(basename ${ENTRY_DST}).*\.${FLAG_BACKEND}") # Print separator line. cli_printMessage '-' --as-separator-line diff --git a/Scripts/Functions/Help/Backends/Texinfo/texinfo_deleteCrossReferences.sh b/Scripts/Functions/Help/Backends/Texinfo/texinfo_deleteCrossReferences.sh index 9472000..c2bc431 100755 --- a/Scripts/Functions/Help/Backends/Texinfo/texinfo_deleteCrossReferences.sh +++ b/Scripts/Functions/Help/Backends/Texinfo/texinfo_deleteCrossReferences.sh @@ -47,7 +47,7 @@ function texinfo_deleteCrossReferences { | cut -d / -f8- \ | tr '/' ' ' \ | sed -r \ - -e "s/(chapter-intro\.texi|\.texi)$//" \ + -e "s/(chapter-intro\.${FLAG_BACKEND}|\.${FLAG_BACKEND})$//" \ -e 's! !( |\\n)!g') # Define regular expression patterns for texinfo cross reference @@ -68,7 +68,7 @@ function texinfo_deleteCrossReferences { REPLACE[1]='@comment --- '`gettext "Removed"`'(\1) ---' # Define list of entries to process. - local ENTRIES=$(cli_getFilesList ${MANUAL_BASEDIR} --pattern='.*\.texi') + local ENTRIES=$(cli_getFilesList ${MANUAL_BASEDIR} --pattern=".*\.${FLAG_BACKEND}") # Update node-related cross references. The node-related cross # reference definition, long ones specially, could require more diff --git a/Scripts/Functions/Help/Backends/Texinfo/texinfo_deleteEntry.sh b/Scripts/Functions/Help/Backends/Texinfo/texinfo_deleteEntry.sh index 140796e..9c4441c 100755 --- a/Scripts/Functions/Help/Backends/Texinfo/texinfo_deleteEntry.sh +++ b/Scripts/Functions/Help/Backends/Texinfo/texinfo_deleteEntry.sh @@ -43,12 +43,12 @@ function texinfo_deleteEntry { if [[ -d ${ENTRY_DIR}/${ENTRY_FILE} ]];then # Add dependent files to list of entries. - ENTRIES="${ENTRIES} $(cli_getFilesList ${ENTRY_DIR}/${ENTRY_FILE} --pattern=".*\.texi")" + ENTRIES="${ENTRIES} $(cli_getFilesList ${ENTRY_DIR}/${ENTRY_FILE} --pattern=".*\.${FLAG_BACKEND}")" # Add dependent directories to list of entries. Be aware of # nested directories. for ENTRY in ${ENTRIES};do - ENTRY_DEP=$(echo $ENTRY | sed -r "s/\.texi$//") + ENTRY_DEP=$(echo $ENTRY | sed -r "s/\.${FLAG_BACKEND}$//") if [[ -d $ENTRY_DEP ]];then ENTRIES="${ENTRIES} ${ENTRY_DEP}" fi diff --git a/Scripts/Functions/Help/Backends/Texinfo/texinfo_renameCrossReferences.sh b/Scripts/Functions/Help/Backends/Texinfo/texinfo_renameCrossReferences.sh index 4f706f9..c832ba0 100755 --- a/Scripts/Functions/Help/Backends/Texinfo/texinfo_renameCrossReferences.sh +++ b/Scripts/Functions/Help/Backends/Texinfo/texinfo_renameCrossReferences.sh @@ -37,17 +37,17 @@ function texinfo_renameCrossReferences { | cut -d / -f8- \ | tr '/' ' ' \ | sed -r \ - -e "s/(chapter-intro\.texi|\.texi)$//") + -e "s/(chapter-intro\.${FLAG_BACKEND}|\.${FLAG_BACKEND})$//") # Define node replacement for target documentation entry. NODE_DST=$(echo "$ENTRY_DST" \ | cut -d / -f8- \ | tr '/' ' ' \ | sed -r \ - -e "s/(chapter-intro\.texi|\.texi)$//") + -e "s/(chapter-intro\.${FLAG_BACKEND}|\.${FLAG_BACKEND})$//") # Define list of entries to process. - ENTRIES=$(cli_getFilesList ${MANUAL_BASEDIR} --pattern='.*\.texi') + ENTRIES=$(cli_getFilesList ${MANUAL_BASEDIR} --pattern=".*\.${FLAG_BACKEND}") # Update node-related cross-references. The node-related cross # reference definition, long ones specially, could require more diff --git a/Scripts/Functions/Help/Backends/Texinfo/texinfo_restoreCrossReferences.sh b/Scripts/Functions/Help/Backends/Texinfo/texinfo_restoreCrossReferences.sh index fb7016a..c288ccc 100755 --- a/Scripts/Functions/Help/Backends/Texinfo/texinfo_restoreCrossReferences.sh +++ b/Scripts/Functions/Help/Backends/Texinfo/texinfo_restoreCrossReferences.sh @@ -51,7 +51,7 @@ function texinfo_restoreCrossReferences { | cut -d / -f8- \ | tr '/' ' ' \ | sed -r \ - -e "s/(chapter-intro\.texi|\.texi)$//") + -e "s/(chapter-intro\.${FLAG_BACKEND}|\.${FLAG_BACKEND})$//") # Define regular expression patterns to match removed message # format produced by message_removeCrossReferences function. @@ -64,7 +64,7 @@ function texinfo_restoreCrossReferences { REPLACE[1]='\1' # Define list of entries to process. - local ENTRIES=$(cli_getFilesList ${MANUAL_BASEDIR} --pattern='.*\.texi') + local ENTRIES=$(cli_getFilesList ${MANUAL_BASEDIR} --pattern=".*\.${FLAG_BACKEND}") # Update node-related cross references. The node-related cross # reference definition, long ones specially, could require more diff --git a/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateChaptersFiles.sh b/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateChaptersFiles.sh index 99464bb..fc9a0e2 100755 --- a/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateChaptersFiles.sh +++ b/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateChaptersFiles.sh @@ -30,9 +30,9 @@ function texinfo_updateChaptersFiles { @node $MANUAL_CHAPTER_NAME @chapter $MANUAL_CHAPTER_NAME @cindex $(echo $MANUAL_CHAPTER_NAME | tr '[[:upper:]]' '[[:lower:]]') - @include $MANUAL_CHAPTER_NAME/chapter-intro.texi - @include $MANUAL_CHAPTER_NAME/chapter-menu.texi - @include $MANUAL_CHAPTER_NAME/chapter-nodes.texi" + @include $MANUAL_CHAPTER_NAME/chapter-intro.$FLAG_BACKEND + @include $MANUAL_CHAPTER_NAME/chapter-menu.$FLAG_BACKEND + @include $MANUAL_CHAPTER_NAME/chapter-nodes.$FLAG_BACKEND" # Remove any space/tabs at the begining of @... lines. CHAPTERBODY=$(echo "$CHAPTERBODY" | sed -r 's!^[[:space:]]+@!@!') @@ -45,11 +45,11 @@ function texinfo_updateChaptersFiles { # Create files to store chapter information. If chapter files # already exist, they will be re-written and any previous # information inside them will be lost. - echo "$CHAPTERBODY" > $MANUAL_CHAPTER_DIR/chapter.texi - echo "" > $MANUAL_CHAPTER_DIR/chapter-menu.texi - echo "" > $MANUAL_CHAPTER_DIR/chapter-nodes.texi + echo "$CHAPTERBODY" > $MANUAL_CHAPTER_DIR/chapter.${FLAG_BACKEND} + echo "" > $MANUAL_CHAPTER_DIR/chapter-menu.${FLAG_BACKEND} + echo "" > $MANUAL_CHAPTER_DIR/chapter-nodes.${FLAG_BACKEND} # Initialize chapter instroduction using template file. - cp ${MANUAL_TEMPLATE}/manual-chapter-intro.texi $MANUAL_CHAPTER_DIR/chapter-intro.texi + cp ${MANUAL_TEMPLATE}/manual-chapter-intro.${FLAG_BACKEND} $MANUAL_CHAPTER_DIR/chapter-intro.${FLAG_BACKEND} } diff --git a/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateChaptersMenu.sh b/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateChaptersMenu.sh index 20bf963..625c4f6 100755 --- a/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateChaptersMenu.sh +++ b/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateChaptersMenu.sh @@ -29,11 +29,11 @@ function texinfo_updateChaptersMenu { # 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.texi) as an included file. To create the final + # 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.texi ]];then - MENUCHAPTERS=$(cat ${MANUAL_BASEFILE}-menu.texi \ + if [[ -f ${MANUAL_BASEFILE}-menu.${FLAG_BACKEND} ]];then + MENUCHAPTERS=$(cat ${MANUAL_BASEFILE}-menu.${FLAG_BACKEND} \ | egrep -v "^(@(end )?menu$|\* Index::.*)$") fi @@ -72,6 +72,6 @@ function texinfo_updateChaptersMenu { | egrep -v '^[[:space:]]*$') # Dump organized menu of chapters into file. - echo "${MENUCHAPTERS}" > ${MANUAL_BASEFILE}-menu.texi + echo "${MENUCHAPTERS}" > ${MANUAL_BASEFILE}-menu.${FLAG_BACKEND} } diff --git a/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateChaptersNodes.sh b/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateChaptersNodes.sh index a28f904..b88a42c 100755 --- a/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateChaptersNodes.sh +++ b/Scripts/Functions/Help/Backends/Texinfo/texinfo_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.texi \ + local CHAPTERNODES=$(cat ${MANUAL_BASEFILE}-menu.${FLAG_BACKEND} \ | egrep -v '^@(end )?menu$' \ | egrep -v "^\* `gettext "Index"`::[[:print:]]*$" \ | sed -r 's!^\* !!' | sed -r 's!::[[:print:]]*$!!g' \ @@ -36,7 +36,7 @@ function texinfo_updateChaptersNodes { local FILENODE=$(\ for CHAPTERNODE in ${CHAPTERNODES};do - INCL=$(echo ${CHAPTERNODE} | sed -r "s!(${CHAPTERNODE})!\1/chapter\.texi!") + INCL=$(echo ${CHAPTERNODE} | sed -r "s!(${CHAPTERNODE})!\1/chapter\.${FLAG_BACKEND}!") # Output inclusion line using texinfo format. echo "@include $INCL" @@ -44,6 +44,6 @@ function texinfo_updateChaptersNodes { done) # Dump organized nodes of chapters into file. - echo "$FILENODE" > ${MANUAL_BASEFILE}-nodes.texi + echo "$FILENODE" > ${MANUAL_BASEFILE}-nodes.${FLAG_BACKEND} } diff --git a/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateMenu.sh b/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateMenu.sh index b5aa015..915f879 100755 --- a/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateMenu.sh +++ b/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateMenu.sh @@ -37,14 +37,14 @@ function texinfo_updateMenu { # Build the menu node related to the entry being processed # currently. local MENUNODE=$(echo "$ENTRY" | cut -d / -f9- | tr '/' ' ' \ - | sed 's!\.texi$!!') + | sed "s!\.${FLAG_BACKEND}$!!") # Give format to menu line using texinfo style. local MENULINE="* ${MANUAL_CHAPTER_NAME} $MENUNODE::" # Define chapter's menu. Remove `@menu', `@end menu', and empty lines # from output. - local MENU=$(cat $MANUAL_CHAPTER_DIR/chapter-menu.texi \ + local MENU=$(cat $MANUAL_CHAPTER_DIR/chapter-menu.${FLAG_BACKEND} \ | egrep -v '^[[:space:]]*$' | egrep -v '^@(end )?menu') # Re-defined chapter's menu based on action. @@ -77,6 +77,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.texi + echo "$MENU" > $MANUAL_CHAPTER_DIR/chapter-menu.${FLAG_BACKEND} } diff --git a/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateNodes.sh b/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateNodes.sh index c0a0d2a..bd9693b 100755 --- a/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateNodes.sh +++ b/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateNodes.sh @@ -27,8 +27,8 @@ function texinfo_updateNodes { local TEXINFO_TEMPLATE='' - # Retrive nodes' entries from chapter-menu.texi file. - local NODES=$(cat $MANUAL_CHAPTER_DIR/chapter-menu.texi \ + # Retrive nodes' entries from chapter-menu.texinfo file. + local NODES=$(cat $MANUAL_CHAPTER_DIR/chapter-menu.${FLAG_BACKEND} \ | sed -r 's!^\* !!' | sed -r 's!:{1,2}.*$!!g' \ | egrep -v '^@(end )?menu$' | sed -r 's! !:!g' | sort | uniq) @@ -37,7 +37,7 @@ function texinfo_updateNodes { NODE=$(echo "${NODE}" | sed -r 's!:! !g') SECT=$(echo "$NODE" | sed -r 's! !/!g' | sed "s!${MANUAL_CHAPTER_NAME}/!!") - INCL=$(echo "$NODE" | sed -r 's! !/!g').texi + INCL=$(echo "$NODE" | sed -r 's! !/!g').${FLAG_BACKEND} CIND=$(echo "$NODE") # Create an empty directory to store texinfo files. @@ -51,9 +51,9 @@ function texinfo_updateNodes { # Define what template to apply using the absolute path of # the documentation entry as reference. if [[ ${MANUAL_BASEDIR}/${INCL} =~ 'trunk/Scripts/Functions/.+' ]];then - TEXINFO_TEMPLATE="${MANUAL_TEMPLATE}/manual-section-functions.texi" + TEXINFO_TEMPLATE="${MANUAL_TEMPLATE}/manual-section-functions.${FLAG_BACKEND}" else - TEXINFO_TEMPLATE="${MANUAL_TEMPLATE}/manual-section.texi" + TEXINFO_TEMPLATE="${MANUAL_TEMPLATE}/manual-section.${FLAG_BACKEND}" fi # Copy template to its destination. @@ -75,6 +75,6 @@ function texinfo_updateNodes { echo "" # Dump node information into chapter node file. - done > $MANUAL_CHAPTER_DIR/chapter-nodes.texi + done > $MANUAL_CHAPTER_DIR/chapter-nodes.${FLAG_BACKEND} } diff --git a/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateOutputFileInfo.sh b/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateOutputFileInfo.sh index 8407d95..a158481 100755 --- a/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateOutputFileInfo.sh +++ b/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateOutputFileInfo.sh @@ -29,7 +29,7 @@ function texinfo_updateOutputFileInfo { cli_printMessage "${MANUAL_BASEFILE}.info.bz2" --as-updating-line # Update info file. - /usr/bin/makeinfo ${MANUAL_BASEFILE}.texi --output=${MANUAL_BASEFILE}.info + /usr/bin/makeinfo ${MANUAL_BASEFILE}.${FLAG_BACKEND} --output=${MANUAL_BASEFILE}.info # Compress info file. if [[ $? -eq 0 ]];then diff --git a/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateOutputFilePdf.sh b/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateOutputFilePdf.sh index e4e4b99..99682d7 100755 --- a/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateOutputFilePdf.sh +++ b/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateOutputFilePdf.sh @@ -30,6 +30,6 @@ function texinfo_updateOutputFilePdf { # Update plaintext output directory. /usr/bin/texi2pdf --quiet \ - ${MANUAL_BASEFILE}.texi --output=${MANUAL_BASEFILE}.pdf + ${MANUAL_BASEFILE}.${FLAG_BACKEND} --output=${MANUAL_BASEFILE}.pdf } diff --git a/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateOutputFilePlaintext.sh b/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateOutputFilePlaintext.sh index 8601513..961fcba 100755 --- a/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateOutputFilePlaintext.sh +++ b/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateOutputFilePlaintext.sh @@ -30,7 +30,7 @@ function texinfo_updateOutputFilePlaintext { # Update plaintext output directory. /usr/bin/makeinfo --plaintext \ - ${MANUAL_BASEFILE}.texi --output=${MANUAL_BASEFILE}.txt + ${MANUAL_BASEFILE}.${FLAG_BACKEND} --output=${MANUAL_BASEFILE}.txt # Compress plaintext output file. if [[ -f ${MANUAL_BASEFILE}.txt ]];then diff --git a/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateOutputFileXhtml.sh b/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateOutputFileXhtml.sh index 168b5c4..8fb393a 100755 --- a/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateOutputFileXhtml.sh +++ b/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateOutputFileXhtml.sh @@ -52,7 +52,7 @@ function texinfo_updateOutputFileXhtml { # format to html using CentOS Web default visual style. texi2html --init-file=${MANUAL_BASEDIR}/${MANUAL_BASEFILE}-init.pl \ --output=${MANUAL_BASEDIR}/${MANUAL_BASEFILE}.xhtml \ - ${MANUAL_BASEDIR}/${MANUAL_BASEFILE}.texi + ${MANUAL_BASEDIR}/${MANUAL_BASEFILE}.${FLAG_BACKEND} # Remove directory where xhtml files are stored from directory # stack. The xhtml files have been already created. diff --git a/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateOutputFileXml.sh b/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateOutputFileXml.sh index acdc47b..83a259e 100755 --- a/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateOutputFileXml.sh +++ b/Scripts/Functions/Help/Backends/Texinfo/texinfo_updateOutputFileXml.sh @@ -30,6 +30,6 @@ function texinfo_updateOutputFileXml { # Update xml output format. /usr/bin/makeinfo --xml \ - ${MANUAL_BASEFILE}.texi --output=${MANUAL_BASEFILE}.xml \ + ${MANUAL_BASEFILE}.${FLAG_BACKEND} --output=${MANUAL_BASEFILE}.xml \ }