| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function texinfo_createStructure { |
| |
| |
| |
| |
| |
| 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='' |
| |
| |
| 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 |
| |
| if [[ $MANUAL_TITLE == '' ]];then |
| cli_printMessage "`gettext "The manual title cannot be empty."`" --as-error-line |
| fi |
| |
| |
| |
| |
| if [[ ! -d ${MANUAL_BASEDIR} ]];then |
| cli_printMessage "${MANUAL_BASEDIR}" --as-creating-line |
| cli_runFnEnvironment vcs --quiet --mkdir ${MANUAL_BASEDIR} |
| fi |
| |
| |
| |
| cli_printMessage "${MANUAL_BASEDIR_L10N}" --as-creating-line |
| cli_runFnEnvironment vcs --quiet --mkdir ${MANUAL_BASEDIR_L10N} |
| |
| |
| local FILE='' |
| local FILES=$(cli_getFilesList "${MANUAL_TEMPLATE_L10N}" \ |
| --maxdepth='1' \ |
| --pattern="^.+/manual((-menu|-nodes|-index)?\.${MANUAL_EXTENSION}|\.conf)$") |
| |
| |
| |
| |
| |
| for FILE in $FILES;do |
| if [[ ! -f ${MANUAL_BASEDIR_L10N}/$(basename ${FILE}) ]];then |
| |
| |
| |
| cli_checkFiles ${FILE} --is-versioned |
| |
| |
| local DST=${MANUAL_BASEDIR_L10N}/$(basename ${FILE} \ |
| | sed -r "s!manual!${MANUAL_NAME}!") |
| |
| |
| cli_printMessage "${DST}" --as-creating-line |
| |
| |
| cli_runFnEnvironment vcs --quiet --copy ${FILE} ${DST} |
| |
| |
| cli_expandTMarkers ${DST} |
| |
| |
| 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 |
| |
| |
| texinfo_createStructureChapters |
| |
| |
| MANUAL_CHANGED_DIRS=${MANUAL_BASEDIR} |
| |
| } |