| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function texinfo { |
| |
| |
| |
| |
| |
| 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 |
| |
| if [[ ! -d $MANUAL_TEMPLATE_L10N ]];then |
| MANUAL_TEMPLATE_L10N=${MANUAL_TEMPLATE}/en_US |
| fi |
| |
| |
| texinfo_createStructure |
| |
| |
| |
| |
| if [[ $MANUAL_CHAPTER_NAME == '' ]];then |
| |
| |
| |
| |
| MANUAL_ENTRY="${MANUAL_BASEFILE}.${MANUAL_EXTENSION}" |
| |
| elif [[ $MANUAL_CHAPTER_NAME != '' ]] && [[ $MANUAL_SECTION_NAME == '' ]];then |
| |
| |
| |
| texinfo_createChapter |
| |
| |
| |
| MANUAL_ENTRY="${MANUAL_BASEDIR_L10N}/${MANUAL_CHAPTER_NAME}.${MANUAL_EXTENSION}" |
| |
| elif [[ $MANUAL_CHAPTER_NAME != '' ]] && [[ $MANUAL_SECTION_NAME != '' ]];then |
| |
| |
| |
| |
| MANUAL_ENTRY="$(texinfo_getEntry "$MANUAL_SECTION_NAME")" |
| |
| else |
| cli_printMessage "`gettext "The parameters you provided are not supported."`" --as-error-line |
| fi |
| |
| |
| |
| |
| if [[ $ACTIONNAM == "" ]];then |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| texinfo_updateOutputFiles |
| |
| |
| info --node="Top" --file="${MANUAL_OUTPUT_BASEFILE}.info.bz2" |
| |
| elif [[ $ACTIONNAM =~ "^(copy|rename|delete)Entry$" ]];then |
| |
| |
| |
| |
| |
| texinfo_${ACTIONNAM} |
| |
| |
| texinfo_updateOutputFiles |
| |
| |
| |
| |
| break |
| |
| else |
| |
| |
| |
| texinfo_${ACTIONNAM} |
| |
| fi |
| |
| } |